diff options
Diffstat (limited to '')
-rw-r--r-- | engagements/tests/conftest.py | 25 | ||||
-rw-r--r-- | engagements/tests/test_models.py | 6 |
2 files changed, 25 insertions, 6 deletions
diff --git a/engagements/tests/conftest.py b/engagements/tests/conftest.py index 72f1c11..b74feb5 100644 --- a/engagements/tests/conftest.py +++ b/engagements/tests/conftest.py @@ -1,8 +1,8 @@ -import pytest - from datetime import date -from engagements.models import EngagementType, Organisation, Engagement, RegulatoryCycle +import pytest + +from engagements.models import Engagement, EngagementStrategy, EngagementType, Organisation, RegulatoryCycle from myuser.models import TeamUser @@ -14,6 +14,25 @@ def regulatory_cycles(): @pytest.fixture +def org(): + return Organisation.objects.create(name="MOD", is_regulated_entity=False) + + +@pytest.fixture +def engagement_strategy(regulatory_cycles, org): + es = EngagementStrategy.objects.create( + name="ES1", + description="ES1 description", + start_year=RegulatoryCycle.objects.get(start_date="2022-01-01"), + end_year=RegulatoryCycle.objects.get(start_date="2024-01-01"), + organisation=org, + management_sign_off="2022-02-10", + inspector_sign_off="2022-01-10", + status="DRAFT", + ) + + +@pytest.fixture def engagement(): data = { "proposed_start_date": "2022-10-01", diff --git a/engagements/tests/test_models.py b/engagements/tests/test_models.py index d7aa458..426d728 100644 --- a/engagements/tests/test_models.py +++ b/engagements/tests/test_models.py @@ -1,7 +1,7 @@ import pytest from engagements.utils import populate_database -from engagements.models import RegulatoryCycle +from engagements.models import RegulatoryCycle, EngagementStrategy pytestmark = pytest.mark.django_db @@ -39,5 +39,5 @@ def test_regulatory_cycle_model(regulatory_cycles): assert str(rc2023) == "Regulatory Cycle: 2023" -# def test_engagement_strategy_model(data): -# assert EngagementStrategy.objects.first() +def test_engagement_strategy_model(engagement_strategy): + assert EngagementStrategy.objects.first() |