chore(itam): Remove old History Tests

ref: #783 #735 #759
This commit is contained in:
2025-06-04 11:30:04 +09:30
parent 2cec1be952
commit 74e54343b9
21 changed files with 0 additions and 934 deletions

View File

@ -1,35 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
from itam.models.device_history import Device, DeviceHistory
class History(
HistoryEntriesCommon,
TestCase,
):
model = Device
history_model = DeviceHistory
@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()

View File

@ -1,35 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
from itam.models.device_model_history import DeviceModel, DeviceModelHistory
class History(
HistoryEntriesCommon,
TestCase,
):
model = DeviceModel
history_model = DeviceModelHistory
@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()

View File

@ -1,63 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesChildModel
from itam.models.device_history import Device, DeviceHistory
from itam.models.device_operating_system_history import DeviceOperatingSystem, DeviceOperatingSystemHistory
from itam.models.operating_system import OperatingSystem, OperatingSystemVersion
class History(
HistoryEntriesChildModel,
TestCase,
):
model = Device
history_model = DeviceHistory
child_model = DeviceOperatingSystem
history_model_child = DeviceOperatingSystemHistory
@classmethod
def setUpTestData(self):
super().setUpTestData()
self.obj = self.model.objects.create(
organization = self.organization,
name = self.field_value_original
)
operating_system = OperatingSystem.objects.create(
organization = self.organization,
name = 'os name'
)
osv = OperatingSystemVersion.objects.create(
organization = self.organization,
name = 'os name',
operating_system = operating_system
)
self.obj_child = self.child_model.objects.create(
organization = self.organization,
device = self.obj,
operating_system_version = osv,
)
self.obj_delete = self.model.objects.create(
organization = self.organization,
name = self.field_value_delete
)
self.field_name_child = 'operating_system_version_id'
self.field_value_child = osv.pk
self.call_the_banners()

View File

@ -1,57 +0,0 @@
from django.test import TestCase
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 = Device
history_model = DeviceHistory
child_model = DeviceSoftware
history_model_child = DeviceSoftwareHistory
@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,
device = 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()

View File

@ -1,35 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
from itam.models.device_type_history import DeviceType, DeviceTypeHistory
class History(
HistoryEntriesCommon,
TestCase,
):
model = DeviceType
history_model = DeviceTypeHistory
@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()

View File

@ -1,38 +0,0 @@
from django.test import TestCase
from accounting.models.asset_base_history import AssetBase, AssetBaseHistory
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
class History(
HistoryEntriesCommon,
TestCase,
):
model = AssetBase
history_model = AssetBaseHistory
@classmethod
def setUpTestData(self):
super().setUpTestData()
self.field_name = 'asset_number'
self.obj = self.model.objects.create(
organization = self.organization,
asset_number = self.field_value_original,
)
self.obj_delete = self.model.objects.create(
organization = self.organization,
asset_number = self.field_value_delete,
)
self.call_the_banners()

View File

@ -1,35 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
from itam.models.operating_system_history import OperatingSystem, OperatingSystemHistory
class History(
HistoryEntriesCommon,
TestCase,
):
model = OperatingSystem
history_model = OperatingSystemHistory
@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()

View File

@ -1,44 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
from itam.models.operating_system import OperatingSystem
from itam.models.operating_system_version_history import OperatingSystemVersion, OperatingSystemVersionHistory
class History(
HistoryEntriesCommon,
TestCase,
):
model = OperatingSystemVersion
history_model = OperatingSystemVersionHistory
@classmethod
def setUpTestData(self):
super().setUpTestData()
self.obj = self.model.objects.create(
organization = self.organization,
name = self.field_value_original,
operating_system = OperatingSystem.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,
operating_system = OperatingSystem.objects.create(
organization = self.organization,
name = 'os name two',
)
)
self.call_the_banners()

View File

@ -1,35 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
from itam.models.software_history import Software, SoftwareHistory
class History(
HistoryEntriesCommon,
TestCase,
):
model = Software
history_model = SoftwareHistory
@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()

View File

@ -1,35 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
from itam.models.software_category_history import SoftwareCategory, SoftwareCategoryHistory
class History(
HistoryEntriesCommon,
TestCase,
):
model = SoftwareCategory
history_model = SoftwareCategoryHistory
@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()

View File

@ -1,44 +0,0 @@
from django.test import TestCase
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
from itam.models.software import Software
from itam.models.software_version_history import SoftwareVersion, SoftwareVersionHistory
class History(
HistoryEntriesCommon,
TestCase,
):
model = SoftwareVersion
history_model = SoftwareVersionHistory
@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 = self.field_value_original,
),
)
self.obj_delete = self.model.objects.create(
organization = self.organization,
name = self.field_value_delete,
software = Software.objects.create(
organization = self.organization,
name = 'software name two',
),
)
self.call_the_banners()

View File

@ -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 itam.models.device_history import Device, DeviceHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = Device
model = DeviceHistory
@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()

View File

@ -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 itam.models.device_model_history import DeviceModel, DeviceModelHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = DeviceModel
model = DeviceModelHistory
@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()

View File

@ -1,63 +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 itam.models.device import Device
from itam.models.device_operating_system_history import DeviceOperatingSystem, DeviceOperatingSystemHistory
from itam.models.operating_system import OperatingSystem, OperatingSystemVersion
class ModelHistoryAPI(
ChildModelHistoryAPI,
TestCase,
):
audit_model = Device
audit_model_child = DeviceOperatingSystem
model = DeviceOperatingSystemHistory
@classmethod
def setUpTestData(self):
super().setUpTestData()
self.audit_object = self.audit_model.objects.create(
organization = self.organization,
name = 'one',
)
osv = OperatingSystemVersion.objects.create(
organization = self.organization,
name = 'one',
operating_system = OperatingSystem.objects.create(
organization = self.organization,
name = 'one',
)
)
self.audit_object_child = self.audit_model_child.objects.create(
organization = self.organization,
device = self.audit_object,
operating_system_version = osv,
)
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()

View File

@ -1,59 +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 itam.models.device import Device
from itam.models.device_software_history import DeviceSoftware, DeviceSoftwareHistory
from itam.models.software import Software
class ModelHistoryAPI(
ChildModelHistoryAPI,
TestCase,
):
audit_model = Device
audit_model_child = DeviceSoftware
model = DeviceSoftwareHistory
@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,
device = 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()

View File

@ -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 itam.models.device_type_history import DeviceType, DeviceTypeHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = DeviceType
model = DeviceTypeHistory
@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()

View File

@ -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 itam.models.operating_system_history import OperatingSystem, OperatingSystemHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = OperatingSystem
model = OperatingSystemHistory
@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()

View File

@ -1,50 +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 itam.models.operating_system import OperatingSystem
from itam.models.operating_system_version_history import OperatingSystemVersion, OperatingSystemVersionHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = OperatingSystemVersion
model = OperatingSystemVersionHistory
@classmethod
def setUpTestData(self):
super().setUpTestData()
os = OperatingSystem.objects.create(
organization = self.organization,
name = 'one',
)
self.audit_object = self.audit_model.objects.create(
organization = self.organization,
name = 'one',
operating_system = os
)
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()

View File

@ -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 itam.models.software_history import Software, SoftwareHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = Software
model = SoftwareHistory
@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()

View File

@ -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 itam.models.software_category_history import SoftwareCategory, SoftwareCategoryHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = SoftwareCategory
model = SoftwareCategoryHistory
@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()

View File

@ -1,48 +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 itam.models.software import Software
from itam.models.software_version_history import SoftwareVersion, SoftwareVersionHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = SoftwareVersion
model = SoftwareVersionHistory
@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.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()