From cdd67e184c07ab0c487a59270c4b5f1edf0544e0 Mon Sep 17 00:00:00 2001 From: MR Lemon Date: Wed, 13 May 2020 17:00:23 +0100 Subject: first passing assessments app test - wiring test only --- ctrack/assessments/tests/conftest.py | 7 +++++++ ctrack/assessments/tests/test_assessments.py | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'ctrack') diff --git a/ctrack/assessments/tests/conftest.py b/ctrack/assessments/tests/conftest.py index 4a9126c..1435c86 100644 --- a/ctrack/assessments/tests/conftest.py +++ b/ctrack/assessments/tests/conftest.py @@ -1,4 +1,11 @@ # TODO Here we need to make use of the populate script to create a massive # test fixture. +import pytest +from ctrack.core.utils import populate_db + + +@pytest.fixture +def full_db_fixture(): + populate_db(orgs=2, igps=2) diff --git a/ctrack/assessments/tests/test_assessments.py b/ctrack/assessments/tests/test_assessments.py index 4443a18..2aaed12 100644 --- a/ctrack/assessments/tests/test_assessments.py +++ b/ctrack/assessments/tests/test_assessments.py @@ -7,11 +7,11 @@ from ctrack.assessments.models import IGP pytestmark = pytest.mark.django_db - -@pytest.mark.skip("Use once we populate the test database") -def test_get_random_igps(): +def test_get_random_igps(full_db_fixture): na = AchievementLevel.objects.filter(descriptor="Not Achieved").first() co1 = CAFContributingOutcome.objects.get(pk=1) igps_co1 = IGP.objects.filter(contributing_outcome=co1, achievement_level=na) - assert False + assert co1.designation == "A1.a" + assert na.descriptor == "Not Achieved" + assert igps_co1.first().descriptive_text[:5] == "IGP 1" -- cgit v1.2.3