aboutsummaryrefslogtreecommitdiff
path: root/tests/managers/thl/test_profiling/test_question.py
diff options
context:
space:
mode:
authorstuppie2026-09-07 11:47:43 -0600
committerstuppie2026-09-07 11:47:43 -0600
commit092960233652cce1f4dc7841856034a6635e9cd9 (patch)
tree46e5fcd4d1e1b7ed0b987980c6c67ffa6e6b45c7 /tests/managers/thl/test_profiling/test_question.py
parent80fd8aab4c7271ddb619b0de18741d7ac77b490b (diff)
parent242579a44855873d5e054e375440e9d3492cd682 (diff)
downloadgeneralresearch-092960233652cce1f4dc7841856034a6635e9cd9.tar.gz
generalresearch-092960233652cce1f4dc7841856034a6635e9cd9.zip
Merge branch 'master' into dev-greg
Diffstat (limited to 'tests/managers/thl/test_profiling/test_question.py')
-rw-r--r--tests/managers/thl/test_profiling/test_question.py32
1 files changed, 26 insertions, 6 deletions
diff --git a/tests/managers/thl/test_profiling/test_question.py b/tests/managers/thl/test_profiling/test_question.py
index 998466e..e4afb87 100644
--- a/tests/managers/thl/test_profiling/test_question.py
+++ b/tests/managers/thl/test_profiling/test_question.py
@@ -1,12 +1,20 @@
+from collections.abc import Callable
+from typing import TYPE_CHECKING
from uuid import uuid4
-from generalresearch.managers.thl.profiling.question import QuestionManager
-from generalresearch.models import Source
+from generalresearch.models.definitions import Source
+
+if TYPE_CHECKING:
+ from generalresearch.managers.thl.profiling.question import QuestionManager
class TestQuestionManager:
- def test_get_multi_upk(self, question_manager: QuestionManager, upk_data):
+ def test_get_multi_upk(
+ self, question_manager: QuestionManager, upk_data: Callable[..., None]
+ ):
+ upk_data()
+
qs = question_manager.get_multi_upk(
question_ids=[
"8a22de34f985476aac85e15547100db8",
@@ -17,13 +25,21 @@ class TestQuestionManager:
)
assert len(qs) == 3
- def test_get_questions_ranked(self, question_manager: QuestionManager, upk_data):
+ def test_get_questions_ranked(
+ self, question_manager: QuestionManager, upk_data: Callable[..., None]
+ ):
+ upk_data()
+
qs = question_manager.get_questions_ranked(country_iso="mx", language_iso="spa")
assert len(qs) >= 40
assert qs[0].importance.task_score > qs[40].importance.task_score
assert all(q.country_iso == "mx" and q.language_iso == "spa" for q in qs)
- def test_lookup_by_property(self, question_manager: QuestionManager, upk_data):
+ def test_lookup_by_property(
+ self, question_manager: QuestionManager, upk_data: Callable[..., None]
+ ):
+ upk_data()
+
q = question_manager.lookup_by_property(
property_code="i:industry", country_iso="us", language_iso="eng"
)
@@ -38,7 +54,11 @@ class TestQuestionManager:
)
assert q.explanation_template
- def test_filter_by_property(self, question_manager: QuestionManager, upk_data):
+ def test_filter_by_property(
+ self, question_manager: QuestionManager, upk_data: Callable[..., None]
+ ):
+ upk_data()
+
lookup = [
("i:industry", "us", "eng"),
("i:industry", "mx", "eng"),