From d18c9006d20e2d65c85438b796b4966709daa25d Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 4 Jun 2025 11:30:29 +0930 Subject: [PATCH] chore(settings): Remove old History Tests ref: #783 #735 #759 --- .../test_functional_app_settings_history.py | 66 ------------------- .../test_functional_external_links_history.py | 34 ---------- .../test_unit_app_settings_history_api_v2.py | 43 ------------ ...test_unit_external_links_history_api_v2.py | 44 ------------- 4 files changed, 187 deletions(-) delete mode 100644 app/settings/tests/functional/app_settings/test_functional_app_settings_history.py delete mode 100644 app/settings/tests/functional/external_links/test_functional_external_links_history.py delete mode 100644 app/settings/tests/unit/app_settings/test_unit_app_settings_history_api_v2.py delete mode 100644 app/settings/tests/unit/external_links/test_unit_external_links_history_api_v2.py diff --git a/app/settings/tests/functional/app_settings/test_functional_app_settings_history.py b/app/settings/tests/functional/app_settings/test_functional_app_settings_history.py deleted file mode 100644 index e2d1e977..00000000 --- a/app/settings/tests/functional/app_settings/test_functional_app_settings_history.py +++ /dev/null @@ -1,66 +0,0 @@ -from django.test import TestCase - -from core.tests.abstract.test_functional_history import HistoryEntriesCommon - -from settings.models.app_settings_history import AppSettings, AppSettingsHistory - - - -class History( - HistoryEntriesCommon, - TestCase, -): - - model = AppSettings - - history_model = AppSettingsHistory - - - @classmethod - def setUpTestData(self): - - super().setUpTestData() - - self.field_name = 'global_organization_id' - - self.field_value_original = self.organization - - self.field_value_changed = self.extra_organization.pk - - self.obj = self.model.objects.get( - owner_organization = None - ) - - self.obj.global_organization = self.field_value_original - - self.obj.save() - - self.obj_delete = None # Object is not deleteable - - self.call_the_banners() - - - - def test_model_history_entry_create(self): - """ Test model to ensure history entries are made - - This test case is a duplicate of a test with the same name. This - model does not have the ability to create/delete. - - On object create a history entry with action `ADD` must be created. - """ - - pass - - - def test_model_history_entry_delete(self): - """ Test model to ensure history entries are made - - This test case is a duplicate of a test with the same name. This - model does not have the ability to create/delete. - - On object delete all history entries must be removed - """ - - pass - diff --git a/app/settings/tests/functional/external_links/test_functional_external_links_history.py b/app/settings/tests/functional/external_links/test_functional_external_links_history.py deleted file mode 100644 index 732a4b41..00000000 --- a/app/settings/tests/functional/external_links/test_functional_external_links_history.py +++ /dev/null @@ -1,34 +0,0 @@ -from django.test import TestCase - -from core.tests.abstract.test_functional_history import HistoryEntriesCommon - -from settings.models.external_link_history import ExternalLink, ExternalLinkHistory - - - -class History( - HistoryEntriesCommon, - TestCase, -): - - model = ExternalLink - - history_model = ExternalLinkHistory - - - @classmethod - def setUpTestData(self): - - super().setUpTestData() - - self.obj = self.model.objects.create( - organization = self.organization, - name = self.field_value_original - ) - - self.obj_delete = self.model.objects.create( - organization = self.organization, - name = self.field_value_delete - ) - - self.call_the_banners() diff --git a/app/settings/tests/unit/app_settings/test_unit_app_settings_history_api_v2.py b/app/settings/tests/unit/app_settings/test_unit_app_settings_history_api_v2.py deleted file mode 100644 index ec3b318e..00000000 --- a/app/settings/tests/unit/app_settings/test_unit_app_settings_history_api_v2.py +++ /dev/null @@ -1,43 +0,0 @@ -from django.contrib.contenttypes.models import ContentType -from django.test import TestCase - -from core.tests.abstract.test_unit_model_history_api_v2 import PrimaryModelHistoryAPI - -from settings.models.app_settings_history import AppSettings, AppSettingsHistory - - - -class ModelHistoryAPI( - PrimaryModelHistoryAPI, - TestCase, -): - - audit_model = AppSettings - - model = AppSettingsHistory - - @classmethod - def setUpTestData(self): - - super().setUpTestData() - - self.audit_object = self.audit_model.objects.get( - owner_organization = None, - ) - - - self.history_entry = self.model.objects.create( - organization = self.organization, - action = self.model.Actions.ADD, - user = self.view_user, - before = {}, - after = {}, - content_type = ContentType.objects.get( - app_label = self.audit_object._meta.app_label, - model = self.audit_object._meta.model_name, - ), - model = self.audit_object, - ) - - - self.make_request() diff --git a/app/settings/tests/unit/external_links/test_unit_external_links_history_api_v2.py b/app/settings/tests/unit/external_links/test_unit_external_links_history_api_v2.py deleted file mode 100644 index b3ad5fbc..00000000 --- a/app/settings/tests/unit/external_links/test_unit_external_links_history_api_v2.py +++ /dev/null @@ -1,44 +0,0 @@ -from django.contrib.contenttypes.models import ContentType -from django.test import TestCase - -from core.tests.abstract.test_unit_model_history_api_v2 import PrimaryModelHistoryAPI - -from settings.models.external_link_history import ExternalLink, ExternalLinkHistory - - - -class ModelHistoryAPI( - PrimaryModelHistoryAPI, - TestCase, -): - - audit_model = ExternalLink - - model = ExternalLinkHistory - - @classmethod - def setUpTestData(self): - - super().setUpTestData() - - self.audit_object = self.audit_model.objects.create( - organization = self.organization, - name = 'one', - ) - - - self.history_entry = self.model.objects.create( - organization = self.audit_object.organization, - action = self.model.Actions.ADD, - user = self.view_user, - before = {}, - after = {}, - content_type = ContentType.objects.get( - app_label = self.audit_object._meta.app_label, - model = self.audit_object._meta.model_name, - ), - model = self.audit_object, - ) - - - self.make_request()