Skip to content

Commit

Permalink
Refactor conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
ShishckovA committed Oct 14, 2023
1 parent 9d82665 commit 134d4eb
Showing 1 changed file with 23 additions and 52 deletions.
75 changes: 23 additions & 52 deletions back-end/src/dms/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,127 +190,98 @@ def call_me(
# Section 6:
# Topic 9


@pytest.fixture
def milspec():
return Milspecialty.objects.create(title="Test milspec", code="123456", available_for=["MO"])
return Milspecialty.objects.create(
title="Test milspec", code="123456", available_for=["MO"]
)


@pytest.fixture
def subject1(milspec):
return Subject.objects.create(
title="Subject S1",
annotation="Annotation for subject 1",
milspecialty=milspec)
title="Subject S1", annotation="Annotation for subject 1", milspecialty=milspec
)


@pytest.fixture
def subject2(milspec):
return Subject.objects.create(
title="Subject S2",
annotation="Annotation for subject 2",
milspecialty=milspec)
title="Subject S2", annotation="Annotation for subject 2", milspecialty=milspec
)


@pytest.fixture
def section1(subject1):
return Section.objects.create(
title="Section 1",
subject=subject1)
return Section.objects.create(title="Section 1", subject=subject1)


@pytest.fixture
def section2(subject1):
return Section.objects.create(
title="Section 2",
subject=subject1)
return Section.objects.create(title="Section 2", subject=subject1)


@pytest.fixture
def section3(subject1):
return Section.objects.create(
title="Section 3",
subject=subject1)
return Section.objects.create(title="Section 3", subject=subject1)


@pytest.fixture
def section4(subject1):
return Section.objects.create(
title="Section 4",
subject=subject1)
return Section.objects.create(title="Section 4", subject=subject1)


@pytest.fixture
def section5(subject2):
return Section.objects.create(
title="Section 5",
subject=subject2)
return Section.objects.create(title="Section 5", subject=subject2)


@pytest.fixture
def section6(subject2):
return Section.objects.create(
title="Section 5",
subject=subject2)
return Section.objects.create(title="Section 5", subject=subject2)


@pytest.fixture
def topic1(section1):
return Topic.objects.create(
title="Topic 1",
section=section1)
return Topic.objects.create(title="Topic 1", section=section1)


@pytest.fixture
def topic2(section1):
return Topic.objects.create(
title="Topic 2",
section=section1)
return Topic.objects.create(title="Topic 2", section=section1)


@pytest.fixture
def topic3(section1):
return Topic.objects.create(
title="Topic 3",
section=section1)
return Topic.objects.create(title="Topic 3", section=section1)


@pytest.fixture
def topic4(section2):
return Topic.objects.create(
title="Topic 4",
section=section2)
return Topic.objects.create(title="Topic 4", section=section2)


@pytest.fixture
def topic5(section2):
return Topic.objects.create(
title="Topic 5",
section=section2)
return Topic.objects.create(title="Topic 5", section=section2)


@pytest.fixture
def topic6(section4):
return Topic.objects.create(
title="Topic 6",
section=section4)
return Topic.objects.create(title="Topic 6", section=section4)


@pytest.fixture
def topic7(section4):
return Topic.objects.create(
title="Topic 7",
section=section4)
return Topic.objects.create(title="Topic 7", section=section4)


@pytest.fixture
def topic8(section5):
return Topic.objects.create(
title="Topic 8",
section=section5)
return Topic.objects.create(title="Topic 8", section=section5)


@pytest.fixture
def topic9(section6):
return Topic.objects.create(
title="Topic 9",
section=section6)
return Topic.objects.create(title="Topic 9", section=section6)

0 comments on commit 134d4eb

Please sign in to comment.