diff options
Diffstat (limited to 'engagements/tests')
-rw-r--r-- | engagements/tests/conftest.py | 5 | ||||
-rw-r--r-- | engagements/tests/test_models.py | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/engagements/tests/conftest.py b/engagements/tests/conftest.py index b74feb5..7ccb9ad 100644 --- a/engagements/tests/conftest.py +++ b/engagements/tests/conftest.py @@ -19,13 +19,14 @@ def org(): @pytest.fixture -def engagement_strategy(regulatory_cycles, org): +def engagement_strategy(regulatory_cycles, org, user): 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, + owned_by=user, + reviewed_by=user, management_sign_off="2022-02-10", inspector_sign_off="2022-01-10", status="DRAFT", diff --git a/engagements/tests/test_models.py b/engagements/tests/test_models.py index 426d728..70ae31a 100644 --- a/engagements/tests/test_models.py +++ b/engagements/tests/test_models.py @@ -1,7 +1,7 @@ import pytest +from engagements.models import EngagementStrategy, RegulatoryCycle from engagements.utils import populate_database -from engagements.models import RegulatoryCycle, EngagementStrategy pytestmark = pytest.mark.django_db @@ -40,4 +40,6 @@ def test_regulatory_cycle_model(regulatory_cycles): def test_engagement_strategy_model(engagement_strategy): - assert EngagementStrategy.objects.first() + es1 = EngagementStrategy.objects.first() + assert es1.organisation.name == "MOD" + assert str(es1) == "Engagement Strategy (2022-2024) - MOD" |