diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-01-12 18:27:56 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-01-12 18:27:56 +0100 |
| commit | 43339caea0a1bc7125740746c568fbe536c96d2e (patch) | |
| tree | d710bb1bff6187bd8389e72641e545326f7a8df7 /archaeological_operations/tests.py | |
| parent | 555868ac554938ce90e181b77971286d7170fdc6 (diff) | |
| download | Ishtar-43339caea0a1bc7125740746c568fbe536c96d2e.tar.bz2 Ishtar-43339caea0a1bc7125740746c568fbe536c96d2e.zip | |
✅ basic tests for all statistics modality
Diffstat (limited to 'archaeological_operations/tests.py')
| -rw-r--r-- | archaeological_operations/tests.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 57950ddd2..e5ca04db0 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -114,11 +114,12 @@ from ishtar_common.tests import ( GenericSerializationTest, WAREHOUSE_FIXTURES, SearchText, + StatisticsTest ) from ishtar_common.serializers import restore_serialized -class FileInit(object): +class FileInit: def login_as_superuser(self): # nosec: hard coded password for test purposes self.client.login(username="username", password="tralala") # nosec @@ -1953,7 +1954,7 @@ def create_operation(user, orga=None, values=None): return models.Operation.objects.create(**dct) -class OperationInitTest(object): +class OperationInitTest: def create_user(self): username, password, self.user = create_user() return self.user @@ -3023,9 +3024,10 @@ class CustomFormTest(TestCase, OperationInitTest): self.assertEqual(result["recordsTotal"], 1) -class OperationSearchTest(TestCase, OperationInitTest, SearchText): +class OperationSearchTest(TestCase, OperationInitTest, SearchText, StatisticsTest): fixtures = FILE_FIXTURES SEARCH_URL = "get-operation" + MODEL = models.Operation def setUp(self): IshtarSiteProfile.objects.get_or_create(slug="default", active=True) @@ -3577,6 +3579,17 @@ class OperationSearchTest(TestCase, OperationInitTest, SearchText): self.assertEqual(values["data"], expected_result) +class SiteSearchTest(TestCase, StatisticsTest): + fixtures = FILE_FIXTURES + SEARCH_URL = "get-site" + MODEL = models.ArchaeologicalSite + + def setUp(self): + IshtarSiteProfile.objects.get_or_create(slug="default", active=True) + self.username, self.password, self.user = create_superuser() + self.site = models.ArchaeologicalSite.objects.create(reference="ref-site") + + class TestPermissionQuery: def setup_permission_queries(self, prefix, model_name, permissions, perm_requests=None, create_profiles=True): |
