@ -1,35 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from config_management.models.config_groups_history import ConfigGroups, ConfigGroupsHistory
|
||||
|
||||
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
|
||||
|
||||
|
||||
|
||||
class History(
|
||||
HistoryEntriesCommon,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
model = ConfigGroups
|
||||
|
||||
history_model = ConfigGroupsHistory
|
||||
|
||||
|
||||
@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,59 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from config_management.models.config_groups_history import ConfigGroups, ConfigGroupsHistory
|
||||
from config_management.models.config_groups_hosts_history import ConfigGroupHosts, ConfigGroupHostsHistory
|
||||
|
||||
from core.tests.abstract.test_functional_history import HistoryEntriesChildModel
|
||||
|
||||
from itam.models.device import Device
|
||||
|
||||
|
||||
|
||||
class History(
|
||||
HistoryEntriesChildModel,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
model = ConfigGroups
|
||||
|
||||
history_model = ConfigGroupsHistory
|
||||
|
||||
child_model = ConfigGroupHosts
|
||||
|
||||
history_model_child = ConfigGroupHostsHistory
|
||||
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
|
||||
self.obj = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_original
|
||||
)
|
||||
|
||||
device = Device.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'device name'
|
||||
)
|
||||
|
||||
|
||||
self.obj_child = self.child_model.objects.create(
|
||||
organization = self.organization,
|
||||
group = self.obj,
|
||||
host = device,
|
||||
)
|
||||
|
||||
self.obj_delete = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_delete
|
||||
)
|
||||
|
||||
self.field_name_child = 'host_id'
|
||||
|
||||
self.field_value_child = device.pk
|
||||
|
||||
|
||||
self.call_the_banners()
|
@ -1,60 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from config_management.models.config_groups_history import ConfigGroups, ConfigGroupsHistory
|
||||
from config_management.models.config_groups_software_history import ConfigGroupSoftware, ConfigGroupSoftwareHistory
|
||||
|
||||
from core.tests.abstract.test_functional_history import HistoryEntriesChildModel
|
||||
|
||||
# from itam.models.device_history import Device, DeviceHistory
|
||||
# from itam.models.device_software_history import DeviceSoftware, DeviceSoftwareHistory
|
||||
from itam.models.software import Software
|
||||
|
||||
|
||||
class History(
|
||||
HistoryEntriesChildModel,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
model = ConfigGroups
|
||||
|
||||
history_model = ConfigGroupsHistory
|
||||
|
||||
child_model = ConfigGroupSoftware
|
||||
|
||||
history_model_child = ConfigGroupSoftwareHistory
|
||||
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
|
||||
self.obj = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_original
|
||||
)
|
||||
|
||||
software = Software.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'software name'
|
||||
)
|
||||
|
||||
|
||||
self.obj_child = self.child_model.objects.create(
|
||||
organization = self.organization,
|
||||
config_group = self.obj,
|
||||
software = software,
|
||||
)
|
||||
|
||||
self.obj_delete = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_delete
|
||||
)
|
||||
|
||||
self.field_name_child = 'software_id'
|
||||
|
||||
self.field_value_child = software.pk
|
||||
|
||||
|
||||
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 config_management.models.config_groups_history import ConfigGroups, ConfigGroupsHistory
|
||||
|
||||
|
||||
|
||||
class ModelHistoryAPI(
|
||||
PrimaryModelHistoryAPI,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
audit_model = ConfigGroups
|
||||
|
||||
model = ConfigGroupsHistory
|
||||
|
||||
@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()
|
@ -1,62 +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 ChildModelHistoryAPI
|
||||
|
||||
from config_management.models.groups import ConfigGroups
|
||||
from config_management.models.config_groups_hosts_history import ConfigGroupHosts, ConfigGroupHostsHistory
|
||||
from itam.models.device import Device
|
||||
|
||||
|
||||
class ModelHistoryAPI(
|
||||
ChildModelHistoryAPI,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
audit_model = ConfigGroups
|
||||
|
||||
audit_model_child = ConfigGroupHosts
|
||||
|
||||
model = ConfigGroupHostsHistory
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
|
||||
self.audit_object = self.audit_model.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'one',
|
||||
)
|
||||
|
||||
|
||||
device = Device.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'one',
|
||||
)
|
||||
|
||||
|
||||
self.audit_object_child = self.audit_model_child.objects.create(
|
||||
organization = self.organization,
|
||||
group = self.audit_object,
|
||||
host = device,
|
||||
)
|
||||
|
||||
|
||||
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,
|
||||
child_model = self.audit_object_child
|
||||
)
|
||||
|
||||
|
||||
self.make_request()
|
@ -1,62 +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 ChildModelHistoryAPI
|
||||
|
||||
from config_management.models.groups import ConfigGroups
|
||||
from config_management.models.config_groups_software_history import ConfigGroupSoftware, ConfigGroupSoftwareHistory
|
||||
from itam.models.software import Software
|
||||
|
||||
|
||||
class ModelHistoryAPI(
|
||||
ChildModelHistoryAPI,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
audit_model = ConfigGroups
|
||||
|
||||
audit_model_child = ConfigGroupSoftware
|
||||
|
||||
model = ConfigGroupSoftwareHistory
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
|
||||
self.audit_object = self.audit_model.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'one',
|
||||
)
|
||||
|
||||
|
||||
software = Software.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'one',
|
||||
)
|
||||
|
||||
|
||||
self.audit_object_child = self.audit_model_child.objects.create(
|
||||
organization = self.organization,
|
||||
config_group = self.audit_object,
|
||||
software = software,
|
||||
)
|
||||
|
||||
|
||||
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,
|
||||
child_model = self.audit_object_child
|
||||
)
|
||||
|
||||
|
||||
self.make_request()
|
Reference in New Issue
Block a user