aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/assessments/tests/test_assessments.py
blob: 2aaed128817504d677e4a12175a53d3b5ccfdf40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest

from ctrack.assessments.models import AchievementLevel
from ctrack.assessments.models import CAFContributingOutcome
from ctrack.assessments.models import IGP

pytestmark = pytest.mark.django_db


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 co1.designation == "A1.a"
    assert na.descriptor == "Not Achieved"
    assert igps_co1.first().descriptive_text[:5] == "IGP 1"