fix(base): on fixture cleanup, only clean if obj exists

ref: #883 #730
This commit is contained in:
2025-07-24 16:02:08 +09:30
parent a84676c227
commit 6b28dbf346
2 changed files with 4 additions and 6 deletions

View File

@ -26,11 +26,9 @@ class ModelTestCases:
@pytest.fixture( scope = 'function' )
def created_model(self, django_db_blocker, model, model_kwargs):
if model._meta.abstract:
model_object = None
yield None
else:
if not model._meta.abstract:
with django_db_blocker.unblock():
@ -42,7 +40,8 @@ class ModelTestCases:
with django_db_blocker.unblock():
model_object.delete()
if model_object:
model_object.delete()

View File

@ -302,7 +302,6 @@ This section details the additional items that may need to be done when adding a
- If the model is a primary model, add it to the model link slash command in `app/core/lib/slash_commands/linked_model.py` function `command_linked_model`
## Knowledge Base Article linking
All Tenancy Models must have the ability to be able to have a knowledge base article linked to it. To do so the following must be done: