aboutsummaryrefslogtreecommitdiff
path: root/test_utils
diff options
context:
space:
mode:
authorMax Nanis2026-08-26 16:46:45 -0700
committerMax Nanis2026-08-26 16:46:45 -0700
commitcf239865ce440e1a71ee2360514eaeb018620ac9 (patch)
tree1fefff4a0bbf10df6431e541aa5a3ff5e76f0663 /test_utils
parent47ea200eac0eaa7bef02f6ebb05de9afad5ee0d7 (diff)
downloadgeneralresearch-cf239865ce440e1a71ee2360514eaeb018620ac9.tar.gz
generalresearch-cf239865ce440e1a71ee2360514eaeb018620ac9.zip
Ruff afternoon!
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/managers/conftest.py2
-rw-r--r--test_utils/models/thl/conftest.py162
-rw-r--r--test_utils/precision/__init__.py0
-rw-r--r--test_utils/precision/conftest.py129
-rw-r--r--test_utils/spectrum/conftest.py58
5 files changed, 349 insertions, 2 deletions
diff --git a/test_utils/managers/conftest.py b/test_utils/managers/conftest.py
index e5d6015..b03a646 100644
--- a/test_utils/managers/conftest.py
+++ b/test_utils/managers/conftest.py
@@ -195,7 +195,7 @@ def setup_cashoutmethod_db(
@pytest.fixture(scope="session")
-def spectrum_manager(spectrum_rw: SqlHelper) -> SpectrumSurveyManager:
+def spectrum_survey_manager(spectrum_rw: SqlHelper) -> SpectrumSurveyManager:
from generalresearch.managers.spectrum.survey import (
SpectrumSurveyManager,
)
diff --git a/test_utils/models/thl/conftest.py b/test_utils/models/thl/conftest.py
index 5b21c6b..907306d 100644
--- a/test_utils/models/thl/conftest.py
+++ b/test_utils/models/thl/conftest.py
@@ -433,3 +433,165 @@ def auditlog_factory(audit_log_manager: AuditLogManager):
)
return _inner
+
+
+@pytest.fixture(scope="session")
+def profiling_info_json() -> str:
+ return (
+ '[{"property_label": "hispanic", "cardinality": "*", "prop_type": "i", "country_iso": "us", '
+ '"property_id": "05170ae296ab49178a075cab2a2073a6", "item_id": "7911ec1468b146ee870951f8ae9cbac1", '
+ '"item_label": "panamanian", "gold_standard": 1, "options": [{"id": "c358c11e72c74fa2880358f1d4be85ab", '
+ '"label": "not_hispanic"}, {"id": "b1d6c475770849bc8e0200054975dc9c", "label": "yes_hispanic"}, '
+ '{"id": "bd1eb44495d84b029e107c188003c2bd", "label": "other_hispanic"}, '
+ '{"id": "f290ad5e75bf4f4ea94dc847f57c1bd3", "label": "mexican"}, '
+ '{"id": "49f50f2801bd415ea353063bfc02d252", "label": "puerto_rican"}, '
+ '{"id": "dcbe005e522f4b10928773926601f8bf", "label": "cuban"}, '
+ '{"id": "467ef8ddb7ac4edb88ba9ef817cbb7e9", "label": "salvadoran"}, '
+ '{"id": "3c98e7250707403cba2f4dc7b877c963", "label": "dominican"}, '
+ '{"id": "981ee77f6d6742609825ef54fea824a8", "label": "guatemalan"}, '
+ '{"id": "81c8057b809245a7ae1b8a867ea6c91e", "label": "colombian"}, '
+ '{"id": "513656d5f9e249fa955c3b527d483b93", "label": "honduran"}, '
+ '{"id": "afc8cddd0c7b4581bea24ccd64db3446", "label": "ecuadorian"}, '
+ '{"id": "61f34b36e80747a89d85e1eb17536f84", "label": "argentinian"}, '
+ '{"id": "5330cfa681d44aa8ade3a6d0ea198e44", "label": "peruvian"}, '
+ '{"id": "e7bceaffd76e486596205d8545019448", "label": "nicaraguan"}, '
+ '{"id": "b7bbb2ebf8424714962e6c4f43275985", "label": "spanish"}, '
+ '{"id": "8bf539785e7a487892a2f97e52b1932d", "label": "venezuelan"}, '
+ '{"id": "7911ec1468b146ee870951f8ae9cbac1", "label": "panamanian"}], "category": [{"id": '
+ '"4fd8381d5a1c4409ab007ca254ced084", "label": "Demographic", "path": "/Demographic", '
+ '"adwords_vertical_id": null}]}, {"property_label": "ethnic_group", "cardinality": "*", "prop_type": '
+ '"i", "country_iso": "us", "property_id": "15070958225d4132b7f6674fcfc979f6", "item_id": '
+ '"64b7114cf08143949e3bcc3d00a5d8a0", "item_label": "other_ethnicity", "gold_standard": 1, "options": [{'
+ '"id": "a72e97f4055e4014a22bee4632cbf573", "label": "caucasians"}, '
+ '{"id": "4760353bc0654e46a928ba697b102735", "label": "black_or_african_american"}, '
+ '{"id": "20ff0a2969fa4656bbda5c3e0874e63b", "label": "asian"}, '
+ '{"id": "107e0a79e6b94b74926c44e70faf3793", "label": "native_hawaiian_or_other_pacific_islander"}, '
+ '{"id": "900fa12691d5458c8665bf468f1c98c1", "label": "native_americans"}, '
+ '{"id": "64b7114cf08143949e3bcc3d00a5d8a0", "label": "other_ethnicity"}], "category": [{"id": '
+ '"4fd8381d5a1c4409ab007ca254ced084", "label": "Demographic", "path": "/Demographic", '
+ '"adwords_vertical_id": null}]}, {"property_label": "educational_attainment", "cardinality": "?", '
+ '"prop_type": "i", "country_iso": "us", "property_id": "2637783d4b2b4075b93e2a156e16e1d8", "item_id": '
+ '"934e7b81d6744a1baa31bbc51f0965d5", "item_label": "other_education", "gold_standard": 1, "options": [{'
+ '"id": "df35ef9e474b4bf9af520aa86630202d", "label": "3rd_grade_completion"}, '
+ '{"id": "83763370a1064bd5ba76d1b68c4b8a23", "label": "8th_grade_completion"}, '
+ '{"id": "f0c25a0670c340bc9250099dcce50957", "label": "not_high_school_graduate"}, '
+ '{"id": "02ff74c872bd458983a83847e1a9f8fd", "label": "high_school_completion"}, '
+ '{"id": "ba8beb807d56441f8fea9b490ed7561c", "label": "vocational_program_completion"}, '
+ '{"id": "65373a5f348a410c923e079ddbb58e9b", "label": "some_college_completion"}, '
+ '{"id": "2d15d96df85d4cc7b6f58911fdc8d5e2", "label": "associate_academic_degree_completion"}, '
+ '{"id": "497b1fedec464151b063cd5367643ffa", "label": "bachelors_degree_completion"}, '
+ '{"id": "295133068ac84424ae75e973dc9f2a78", "label": "some_graduate_completion"}, '
+ '{"id": "e64f874faeff4062a5aa72ac483b4b9f", "label": "masters_degree_completion"}, '
+ '{"id": "cbaec19a636d476385fb8e7842b044f5", "label": "doctorate_degree_completion"}, '
+ '{"id": "934e7b81d6744a1baa31bbc51f0965d5", "label": "other_education"}], "category": [{"id": '
+ '"4fd8381d5a1c4409ab007ca254ced084", "label": "Demographic", "path": "/Demographic", '
+ '"adwords_vertical_id": null}]}, {"property_label": "household_spoken_language", "cardinality": "*", '
+ '"prop_type": "i", "country_iso": "us", "property_id": "5a844571073d482a96853a0594859a51", "item_id": '
+ '"62b39c1de141422896ad4ab3c4318209", "item_label": "dut", "gold_standard": 1, "options": [{"id": '
+ '"f65cd57b79d14f0f8460761ce41ec173", "label": "ara"}, {"id": "6d49de1f8f394216821310abd29392d9", '
+ '"label": "zho"}, {"id": "be6dc23c2bf34c3f81e96ddace22800d", "label": "eng"}, '
+ '{"id": "ddc81f28752d47a3b1c1f3b8b01a9b07", "label": "fre"}, {"id": "2dbb67b29bd34e0eb630b1b8385542ca", '
+ '"label": "ger"}, {"id": "a747f96952fc4b9d97edeeee5120091b", "label": "hat"}, '
+ '{"id": "7144b04a3219433baac86273677551fa", "label": "hin"}, {"id": "e07ff3e82c7149eaab7ea2b39ee6a6dc", '
+ '"label": "ita"}, {"id": "b681eff81975432ebfb9f5cc22dedaa3", "label": "jpn"}, '
+ '{"id": "5cb20440a8f64c9ca62fb49c1e80cdef", "label": "kor"}, {"id": "171c4b77d4204bc6ac0c2b81e38a10ff", '
+ '"label": "pan"}, {"id": "8c3ec18e6b6c4a55a00dd6052e8e84fb", "label": "pol"}, '
+ '{"id": "3ce074d81d384dd5b96f1fb48f87bf01", "label": "por"}, {"id": "6138dc951990458fa88a666f6ddd907b", '
+ '"label": "rus"}, {"id": "e66e5ecc07df4ebaa546e0b436f034bd", "label": "spa"}, '
+ '{"id": "5a981b3d2f0d402a96dd2d0392ec2fcb", "label": "tgl"}, {"id": "b446251bd211403487806c4d0a904981", '
+ '"label": "vie"}, {"id": "92fb3ee337374e2db875fb23f52eed46", "label": "xxx"}, '
+ '{"id": "8b1f590f12f24cc1924d7bdcbe82081e", "label": "ind"}, {"id": "bf3f4be556a34ff4b836420149fd2037", '
+ '"label": "tur"}, {"id": "87ca815c43ba4e7f98cbca98821aa508", "label": "zul"}, '
+ '{"id": "0adbf915a7a64d67a87bb3ce5d39ca54", "label": "may"}, {"id": "62b39c1de141422896ad4ab3c4318209", '
+ '"label": "dut"}], "category": [{"id": "4fd8381d5a1c4409ab007ca254ced084", "label": "Demographic", '
+ '"path": "/Demographic", "adwords_vertical_id": null}]}, {"property_label": "gender", "cardinality": '
+ '"?", "prop_type": "i", "country_iso": "us", "property_id": "73175402104741549f21de2071556cd7", '
+ '"item_id": "093593e316344cd3a0ac73669fca8048", "item_label": "other_gender", "gold_standard": 1, '
+ '"options": [{"id": "b9fc5ea07f3a4252a792fd4a49e7b52b", "label": "male"}, '
+ '{"id": "9fdb8e5e18474a0b84a0262c21e17b56", "label": "female"}, '
+ '{"id": "093593e316344cd3a0ac73669fca8048", "label": "other_gender"}], "category": [{"id": '
+ '"4fd8381d5a1c4409ab007ca254ced084", "label": "Demographic", "path": "/Demographic", '
+ '"adwords_vertical_id": null}]}, {"property_label": "age_in_years", "cardinality": "?", "prop_type": '
+ '"n", "country_iso": "us", "property_id": "94f7379437874076b345d76642d4ce6d", "item_id": null, '
+ '"item_label": null, "gold_standard": 1, "category": [{"id": "4fd8381d5a1c4409ab007ca254ced084", '
+ '"label": "Demographic", "path": "/Demographic", "adwords_vertical_id": null}]}, {"property_label": '
+ '"children_age_gender", "cardinality": "*", "prop_type": "i", "country_iso": "us", "property_id": '
+ '"e926142fcea94b9cbbe13dc7891e1e7f", "item_id": "b7b8074e95334b008e8958ccb0a204f1", "item_label": '
+ '"female_18", "gold_standard": 1, "options": [{"id": "16a6448ec24c48d4993d78ebee33f9b4", '
+ '"label": "male_under_1"}, {"id": "809c04cb2e3b4a3bbd8077ab62cdc220", "label": "female_under_1"}, '
+ '{"id": "295e05bb6a0843bc998890b24c99841e", "label": "no_children"}, '
+ '{"id": "142cb948d98c4ae8b0ef2ef10978e023", "label": "male_0"}, '
+ '{"id": "5a5c1b0e9abc48a98b3bc5f817d6e9d0", "label": "male_1"}, '
+ '{"id": "286b1a9afb884bdfb676dbb855479d1e", "label": "male_2"}, '
+ '{"id": "942ca3cda699453093df8cbabb890607", "label": "male_3"}, '
+ '{"id": "995818d432f643ec8dd17e0809b24b56", "label": "male_4"}, '
+ '{"id": "f38f8b57f25f4cdea0f270297a1e7a5c", "label": "male_5"}, '
+ '{"id": "975df709e6d140d1a470db35023c432d", "label": "male_6"}, '
+ '{"id": "f60bd89bbe0f4e92b90bccbc500467c2", "label": "male_7"}, '
+ '{"id": "6714ceb3ed5042c0b605f00b06814207", "label": "male_8"}, '
+ '{"id": "c03c2f8271d443cf9df380e84b4dea4c", "label": "male_9"}, '
+ '{"id": "11690ee0f5a54cb794f7ddd010d74fa2", "label": "male_10"}, '
+ '{"id": "17bef9a9d14b4197b2c5609fa94b0642", "label": "male_11"}, '
+ '{"id": "e79c8338fe28454f89ccc78daf6f409a", "label": "male_12"}, '
+ '{"id": "3a4f87acb3fa41f4ae08dfe2858238c1", "label": "male_13"}, '
+ '{"id": "36ffb79d8b7840a7a8cb8d63bbc8df59", "label": "male_14"}, '
+ '{"id": "1401a508f9664347aee927f6ec5b0a40", "label": "male_15"}, '
+ '{"id": "6e0943c5ec4a4f75869eb195e3eafa50", "label": "male_16"}, '
+ '{"id": "47d4b27b7b5242758a9fff13d3d324cf", "label": "male_17"}, '
+ '{"id": "9ce886459dd44c9395eb77e1386ab181", "label": "female_0"}, '
+ '{"id": "6499ccbf990d4be5b686aec1c7353fd8", "label": "female_1"}, '
+ '{"id": "d85ceaa39f6d492abfc8da49acfd14f2", "label": "female_2"}, '
+ '{"id": "18edb45c138e451d8cb428aefbb80f9c", "label": "female_3"}, '
+ '{"id": "bac6f006ed9f4ccf85f48e91e99fdfd1", "label": "female_4"}, '
+ '{"id": "5a6a1a8ad00c4ce8be52dcb267b034ff", "label": "female_5"}, '
+ '{"id": "6bff0acbf6364c94ad89507bcd5f4f45", "label": "female_6"}, '
+ '{"id": "d0d56a0a6b6f4516a366a2ce139b4411", "label": "female_7"}, '
+ '{"id": "bda6028468044b659843e2bef4db2175", "label": "female_8"}, '
+ '{"id": "dbb6d50325464032b456357b1a6e5e9c", "label": "female_9"}, '
+ '{"id": "b87a93d7dc1348edac5e771684d63fb8", "label": "female_10"}, '
+ '{"id": "11449d0d98f14e27ba47de40b18921d7", "label": "female_11"}, '
+ '{"id": "16156501e97b4263962cbbb743840292", "label": "female_12"}, '
+ '{"id": "04ee971c89a345cc8141a45bce96050c", "label": "female_13"}, '
+ '{"id": "e818d310bfbc4faba4355e5d2ed49d4f", "label": "female_14"}, '
+ '{"id": "440d25e078924ba0973163153c417ed6", "label": "female_15"}, '
+ '{"id": "78ff804cc9b441c5a524bd91e3d1f8bf", "label": "female_16"}, '
+ '{"id": "4b04d804d7d84786b2b1c22e4ed440f5", "label": "female_17"}, '
+ '{"id": "28bc848cd3ff44c3893c76bfc9bc0c4e", "label": "male_18"}, '
+ '{"id": "b7b8074e95334b008e8958ccb0a204f1", "label": "female_18"}], "category": [{"id": '
+ '"e18ba6e9d51e482cbb19acf2e6f505ce", "label": "Parenting", "path": "/People & Society/Family & '
+ 'Relationships/Family/Parenting", "adwords_vertical_id": "58"}]}, {"property_label": "home_postal_code", '
+ '"cardinality": "?", "prop_type": "x", "country_iso": "us", "property_id": '
+ '"f3b32ebe78014fbeb1ed6ff77d6338bf", "item_id": null, "item_label": null, "gold_standard": 1, '
+ '"category": [{"id": "4fd8381d5a1c4409ab007ca254ced084", "label": "Demographic", "path": "/Demographic", '
+ '"adwords_vertical_id": null}]}, {"property_label": "household_income", "cardinality": "?", "prop_type": '
+ '"n", "country_iso": "us", "property_id": "ff5b1d4501d5478f98de8c90ef996ac1", "item_id": null, '
+ '"item_label": null, "gold_standard": 1, "category": [{"id": "4fd8381d5a1c4409ab007ca254ced084", '
+ '"label": "Demographic", "path": "/Demographic", "adwords_vertical_id": null}]}]'
+ )
+
+
+@pytest.fixture(scope="session")
+def profiling_user_info_json() -> str:
+ return (
+ '{"user_profile_knowledge": [], "marketplace_profile_knowledge": [{"source": "d", "question_id": '
+ '"1", "answer": ["1"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": "pr", '
+ '"question_id": "3", "answer": ["1"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": '
+ '"h", "question_id": "60", "answer": ["58"], "created": "2023-11-07T16:41:05.234096Z"}, '
+ '{"source": "c", "question_id": "43", "answer": ["1"], "created": "2023-11-07T16:41:05.234096Z"}, '
+ '{"source": "s", "question_id": "211", "answer": ["111"], "created": '
+ '"2023-11-07T16:41:05.234096Z"}, {"source": "s", "question_id": "1843", "answer": ["111"], '
+ '"created": "2023-11-07T16:41:05.234096Z"}, {"source": "h", "question_id": "13959", "answer": ['
+ '"244155"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": "c", "question_id": "33092", '
+ '"answer": ["1"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": "c", "question_id": "gender", '
+ '"answer": ["10682"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": "e", "question_id": '
+ '"gender", "answer": ["male"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": "f", '
+ '"question_id": "gender", "answer": ["male"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": '
+ '"i", "question_id": "gender", "answer": ["1"], "created": "2023-11-07T16:41:05.234096Z"}, '
+ '{"source": "c", "question_id": "137510", "answer": ["1"], "created": "2023-11-07T16:41:05.234096Z"}, '
+ '{"source": "m", "question_id": "gender", "answer": ["1"], "created": '
+ '"2023-11-07T16:41:05.234096Z"}, {"source": "o", "question_id": "gender", "answer": ["male"], '
+ '"created": "2023-11-07T16:41:05.234096Z"}, {"source": "c", "question_id": "gender_plus", "answer": ['
+ '"7657644"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": "i", "question_id": '
+ '"gender_plus", "answer": ["1"], "created": "2023-11-07T16:41:05.234096Z"}, {"source": "c", '
+ '"question_id": "income_level", "answer": ["9071"], "created": "2023-11-07T16:41:05.234096Z"}]}'
+ )
diff --git a/test_utils/precision/__init__.py b/test_utils/precision/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test_utils/precision/__init__.py
diff --git a/test_utils/precision/conftest.py b/test_utils/precision/conftest.py
new file mode 100644
index 0000000..7acfe6a
--- /dev/null
+++ b/test_utils/precision/conftest.py
@@ -0,0 +1,129 @@
+from typing import Any
+
+import pytest
+
+
+@pytest.fixture(scope="session")
+def precision_survey_json() -> dict[str, Any]:
+ return {
+ "cpi": "1.44",
+ "country_isos": "ca",
+ "language_isos": "eng",
+ "country_iso": "ca",
+ "language_iso": "eng",
+ "buyer_id": "7047",
+ "bid_loi": 1200,
+ "bid_ir": 0.45,
+ "source": "e",
+ "used_question_ids": ["age", "country_iso", "gender", "gender_1"],
+ "survey_id": "0000",
+ "group_id": "633473",
+ "status": "open",
+ "name": "beauty survey",
+ "survey_guid": "c7f375c5077d4c6c8209ff0b539d7183",
+ "category_id": "-1",
+ "global_conversion": None,
+ "desired_count": 96,
+ "achieved_count": 0,
+ "allowed_devices": "1,2,3",
+ "entry_link": "https://www.opinionetwork.com/survey/entry.aspx?mid=[%MID%]&project=633473&key=%%key%%",
+ "excluded_surveys": "470358,633286",
+ "quotas": [
+ {
+ "name": "25-34,Male,Quebec",
+ "id": "2324110",
+ "guid": "23b5760d24994bc08de451b3e62e77c7",
+ "status": "open",
+ "desired_count": 48,
+ "achieved_count": 0,
+ "termination_count": 0,
+ "overquota_count": 0,
+ "condition_hashes": ["b41e1a3", "bc89ee8", "4124366", "9f32c61"],
+ },
+ {
+ "name": "25-34,Female,Quebec",
+ "id": "2324111",
+ "guid": "0706f1a88d7e4f11ad847c03012e68d2",
+ "status": "open",
+ "desired_count": 48,
+ "achieved_count": 0,
+ "termination_count": 4,
+ "overquota_count": 0,
+ "condition_hashes": ["b41e1a3", "0cdc304", "500af2c", "9f32c61"],
+ },
+ ],
+ "conditions": {
+ "b41e1a3": {
+ "logical_operator": "OR",
+ "value_type": 1,
+ "negate": False,
+ "question_id": "country_iso",
+ "values": ["ca"],
+ "criterion_hash": "b41e1a3",
+ "value_len": 1,
+ "sizeof": 2,
+ },
+ "bc89ee8": {
+ "logical_operator": "OR",
+ "value_type": 1,
+ "negate": False,
+ "question_id": "gender",
+ "values": ["male"],
+ "criterion_hash": "bc89ee8",
+ "value_len": 1,
+ "sizeof": 4,
+ },
+ "4124366": {
+ "logical_operator": "OR",
+ "value_type": 1,
+ "negate": False,
+ "question_id": "gender_1",
+ "values": ["male"],
+ "criterion_hash": "4124366",
+ "value_len": 1,
+ "sizeof": 4,
+ },
+ "9f32c61": {
+ "logical_operator": "OR",
+ "value_type": 1,
+ "negate": False,
+ "question_id": "age",
+ "values": ["25", "26", "27", "28", "29", "30", "31", "32", "33", "34"],
+ "criterion_hash": "9f32c61",
+ "value_len": 10,
+ "sizeof": 20,
+ },
+ "0cdc304": {
+ "logical_operator": "OR",
+ "value_type": 1,
+ "negate": False,
+ "question_id": "gender",
+ "values": ["female"],
+ "criterion_hash": "0cdc304",
+ "value_len": 1,
+ "sizeof": 6,
+ },
+ "500af2c": {
+ "logical_operator": "OR",
+ "value_type": 1,
+ "negate": False,
+ "question_id": "gender_1",
+ "values": ["female"],
+ "criterion_hash": "500af2c",
+ "value_len": 1,
+ "sizeof": 6,
+ },
+ },
+ "expected_end_date": "2024-06-28T10:40:33.000000Z",
+ "created": None,
+ "updated": None,
+ "is_live": True,
+ "all_hashes": [
+ "0cdc304",
+ "b41e1a3",
+ "9f32c61",
+ "bc89ee8",
+ "4124366",
+ "500af2c",
+ ],
+ }
diff --git a/test_utils/spectrum/conftest.py b/test_utils/spectrum/conftest.py
index eb2e289..d186a5b 100644
--- a/test_utils/spectrum/conftest.py
+++ b/test_utils/spectrum/conftest.py
@@ -1,7 +1,10 @@
+from __future__ import annotations
+
import logging
import time
from datetime import UTC, datetime
-from typing import TYPE_CHECKING
+from decimal import Decimal
+from typing import TYPE_CHECKING, Any
import pytest
@@ -83,3 +86,56 @@ def setup_spectrum_surveys(
conn.commit()
# Wait a second to make sure the spectrum-grpc pulls these from the db into global-vars
time.sleep(1)
+
+
+@pytest.fixture(scope="session")
+def spectrum_api_survey_json() -> dict[str, Any]:
+ return {
+ "survey_id": 29333264,
+ "survey_name": "#29333264",
+ "survey_status": 22,
+ "field_end_date": datetime(2024, 5, 23, 18, 18, 31, tzinfo=UTC),
+ "category": "Exciting New",
+ "category_code": 232,
+ "crtd_on": datetime(2024, 5, 20, 17, 48, 13, tzinfo=UTC),
+ "mod_on": datetime(2024, 5, 20, 18, 18, 31, tzinfo=UTC),
+ "soft_launch": False,
+ "click_balancing": 0,
+ "price_type": 1,
+ "pii": False,
+ "buyer_message": "",
+ "buyer_id": 4726,
+ "incl_excl": 0,
+ "cpi": Decimal("1.20"),
+ "last_complete_date": None,
+ "project_last_complete_date": None,
+ "quotas": [
+ {
+ "quota_id": "c2bc961e-4f26-4223-b409-ebe9165cfdf5",
+ "quantities": {"currently_open": 491, "remaining": 495, "achieved": 0},
+ "criteria": [
+ {
+ "qualification_code": 214,
+ "range_sets": [{"units": 311, "to": 64, "from": 18}],
+ }
+ ],
+ }
+ ],
+ "qualifications": [
+ {
+ "range_sets": [{"units": 311, "to": 64, "from": 18}],
+ "qualification_code": 212,
+ },
+ {"condition_codes": ["111", "117", "112"], "qualification_code": 1202},
+ ],
+ "country_iso": "fr",
+ "language_iso": "fre",
+ "bid_ir": 0.4,
+ "bid_loi": 600,
+ "overall_ir": None,
+ "overall_loi": None,
+ "last_block_ir": None,
+ "last_block_loi": None,
+ "survey_exclusions": set(),
+ "exclusion_period": 0,
+ }