test(access): Correct history link test cases

ref: #722 #684
This commit is contained in:
2025-04-15 17:09:38 +09:30
parent 8984aeebb8
commit 8f69e6ec79
4 changed files with 7 additions and 3 deletions

View File

@ -42,6 +42,8 @@ class Contact(
documentation = ''
history_model_name = 'contact'
page_layout: list = [
{
"name": "Details",

View File

@ -65,6 +65,8 @@ class Person(
documentation = ''
history_model_name = 'person'
page_layout: dict = []
table_fields: list = [

View File

@ -130,7 +130,7 @@ class APITestCases(
_urls.history field must use the endpoint for entity model
"""
assert str(self.api_data['_urls']['history']).endswith('/access/entity/' + str(self.item.pk) + '/history')
assert str(self.api_data['_urls']['history']).endswith('/' + str(self.item._meta.app_label) + '/' + str(self.item._meta.model_name) + '/' + str(self.item.pk) + '/history')

View File

@ -33,7 +33,7 @@ class EntityModelTestCases(
history_app_name is of type str
"""
assert self.model.history_app_label == 'access'
assert self.model.history_app_label == self.model._meta.app_label
@ -53,7 +53,7 @@ class EntityModelTestCases(
history_model_name is of type str
"""
assert self.model.history_model_name == 'entity'
assert self.model.history_model_name == self.model._meta.model_name