Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehmassgov committed Nov 27, 2024
1 parent 48f2dc4 commit 7596bdc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion api/tests/src/api/agencies_v1/test_agencies_routes.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 7596bdc

Please sign in to comment.