test(access): API Field Checks for Organization History

ref: #605 #607
This commit is contained in:
2025-02-19 23:37:28 +09:30
parent 0275c7a211
commit 2c2ed724c3

View File

@ -0,0 +1,40 @@
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 access.models.organization_history import Organization, OrganizationHistory
class ModelHistoryAPI(
PrimaryModelHistoryAPI,
TestCase,
):
audit_model = Organization
model = OrganizationHistory
@classmethod
def setUpTestData(self):
super().setUpTestData()
self.audit_object = self.organization
self.history_entry = self.model.objects.create(
organization = self.audit_object,
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()