Skip to content

Commit ff334cd

Browse files
fix tests
1 parent 50c35c6 commit ff334cd

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

unittests/test_adminsite.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ def test_is_model_defined(self):
1212
if subclass._meta.proxy:
1313
continue
1414
if subclass.__module__ == "dojo.models":
15+
# Skip pghistory Event models - they're audit trail models not meant for admin
16+
if subclass.__name__.endswith("Event"):
17+
continue
1518
if not ((subclass.__name__[:9] == "Tagulous_") and (subclass.__name__[-5:] == "_tags")):
1619
with self.subTest(type="base", subclass=subclass):
1720
self.assertIn(subclass, admin.site._registry.keys(), f"{subclass} is not registered in 'admin.site' in models.py")

unittests/test_apiv2_methods_and_endpoints.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ def test_is_defined(self):
124124
continue
125125
if subclass.__name__ == "Alerts":
126126
continue
127+
# Skip pghistory Event models - they're audit trail models not meant for API endpoints
128+
if subclass.__name__.endswith("Event"):
129+
continue
127130
with self.subTest(subclass=subclass):
128131
if subclass in self.used_models:
129132
self.assertNotIn(subclass, self.no_api_models, "Thank you, you just implemented API endpoint for the model which was needed. Please remove it from exception list 'self.no_api_models'")

0 commit comments

Comments
 (0)