aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/conftest.py18
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()