Skip to content

Commit 229e408

Browse files
committed
fix tests
1 parent f8b9ad7 commit 229e408

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

netbox_custom_objects/tests/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ def setUp(self):
2323
self.client = Client()
2424
self.client.force_login(self.user)
2525

26+
def tearDown(self):
27+
"""Clean up after each test."""
28+
# Clear the model cache to ensure test isolation
29+
# This prevents cached models with deleted fields from affecting other tests
30+
CustomObjectType.clear_model_cache()
31+
super().tearDown()
32+
2633
@classmethod
2734
def create_custom_object_type(cls, **kwargs):
2835
"""Helper method to create a custom object type."""

0 commit comments

Comments
 (0)