Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests sans toucher la base de données #56

Draft
wants to merge 1 commit into
base: nourriture_pour_pensee
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions gsl_core/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@
RegionFactory,
)

pytestmark = pytest.mark.django_db


@pytest.fixture
def region_idf() -> Region:
return RegionFactory(name="Île-de-France", insee_code="11")
return RegionFactory.build(name="Île-de-France", insee_code="11")


@pytest.fixture
def region_normandie() -> Region:
return RegionFactory(name="Normandie", insee_code="28")
return RegionFactory.build(name="Normandie", insee_code="28")


@pytest.fixture
def dept_75(region_idf) -> Departement:
return DepartementFactory(insee_code="75", name="Paris", region=region_idf)
return DepartementFactory.build(insee_code="75", name="Paris", region=region_idf)


@pytest.fixture
def dept_76(region_normandie) -> Departement:
return DepartementFactory(
return DepartementFactory.build(
insee_code="76", name="Seine-Maritime", region=region_normandie
)


@pytest.fixture
def arr_paris_centre(dept_75) -> Arrondissement:
return ArrondissementFactory(
return ArrondissementFactory.build(
insee_code="75101", name="Paris Centre", departement=dept_75
)


@pytest.fixture
def arr_le_havre(dept_76) -> Arrondissement:
return ArrondissementFactory(insee_code="762", name="Le Havre", departement=dept_76)
return ArrondissementFactory.build(
insee_code="762", name="Le Havre", departement=dept_76
)


def test_clean_valid_perimetre(region_idf, dept_75):
Expand Down