@ -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
|
||||
|
@ -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()
|
@ -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()
|
@ -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()
|
Reference in New Issue
Block a user