Skip to content

Commit

Permalink
🐛(api) remove factory usage in /statique list endpoint
Browse files Browse the repository at this point in the history
Using factories even for demonstration purpose was a bad idea.
  • Loading branch information
jmaupetit committed Apr 10, 2024
1 parent 831c3ec commit 5535550
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions src/api/qualicharge/api/v1/routers/statique.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from pydantic import BaseModel, computed_field

from qualicharge.conf import settings
from qualicharge.factories.static import StatiqueFactory
from qualicharge.models.static import Statique

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -38,16 +37,7 @@ def size(self) -> int:
@router.get("/")
async def list() -> List[Statique]:
"""List statique items."""
telephone_operateur = "0123456789"
id_station_itinerance = "ESZUNP8891687432127666088"
id_pdc_itinerance = "ESZUNE1111ER1"

return StatiqueFactory.batch(
size=10,
telephone_operateur=telephone_operateur,
id_station_itinerance=id_station_itinerance,
id_pdc_itinerance=id_pdc_itinerance,
)
return []


@router.post("/", status_code=status.HTTP_201_CREATED)
Expand Down
2 changes: 1 addition & 1 deletion src/api/tests/api/v1/routers/test_statique.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_list(client_auth):
response = client_auth.get("/statique/")
assert response.status_code == status.HTTP_200_OK
json_response = response.json()
expected_size = 10
expected_size = 0
assert len(json_response) == expected_size


Expand Down

0 comments on commit 5535550

Please sign in to comment.