diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-01 10:38:26 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-01 10:38:26 +0100 |
commit | 9b9643aa058f92b696e4c6a87a2247699b7099b3 (patch) | |
tree | e26fa662a93c56669ec2f1174f1e9c7faf68b87f /ctrack/conftest.py | |
parent | aafd30c1eea5a4b97b9afd99d8c55832031ce60f (diff) |
test for model function to get cafs from an applicable system
Diffstat (limited to '')
-rw-r--r-- | ctrack/conftest.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ctrack/conftest.py b/ctrack/conftest.py index bca55ef..2296070 100644 --- a/ctrack/conftest.py +++ b/ctrack/conftest.py @@ -7,6 +7,9 @@ from django.test import RequestFactory from selenium import webdriver from selenium.webdriver.firefox.options import Options +from ctrack.caf.models import CAF +from ctrack.caf.tests.factories import GradingFactory +from ctrack.core.utils import _create_caf_app_service from ctrack.organisations.models import ( Address, AddressType, @@ -147,6 +150,21 @@ def request_factory() -> RequestFactory: @pytest.fixture +def caf(org) -> CAF: + # Quality gradings + q_descriptors = ["Q1", "Q2", "Q3", "Q4", "Q5"] + for g in q_descriptors: + GradingFactory.create(descriptor=g, type="QUALITY") + + # Confidence gradings + c_descriptors = ["C1", "C2", "C3", "C4", "C5"] + for g in c_descriptors: + GradingFactory.create(descriptor=g, type="CONFIDENCE") + caf = _create_caf_app_service(c_descriptors, org, q_descriptors) + return caf + + +@pytest.fixture def browser(request): "Provide selenium webdriver instance." os.environ["PATH"] += os.pathsep + os.getcwd() |