diff --git a/api/tests/src/api/agencies_v1/test_agencies_routes.py b/api/tests/src/api/agencies_v1/test_agencies_routes.py index 497862d5a..70ee42802 100644 --- a/api/tests/src/api/agencies_v1/test_agencies_routes.py +++ b/api/tests/src/api/agencies_v1/test_agencies_routes.py @@ -1,7 +1,19 @@ -from src.db.models.agency_models import Agency +import pytest + +from src.db.models.agency_models import Agency, LinkAgencyDownloadFileType from tests.src.db.models.factories import AgencyFactory +@pytest.fixture(autouse=True) +def cleanup_agencies(db_session): + yield + # Delete related records first + db_session.query(LinkAgencyDownloadFileType).delete() + # Then delete agencies + db_session.query(Agency).delete() + db_session.commit() + + def test_agencies_get_default_dates(client, api_auth_token, enable_factory_create, db_session): # These should return in the default date range AgencyFactory.create_batch(20)