test(assistance): Model Functional Test Suite re-written to pytest for model KnowledgeBase

ref: #904 closes #900
This commit is contained in:
2025-07-29 14:37:32 +09:30
parent cc481f94e9
commit cf5b78b6b2
5 changed files with 31 additions and 14 deletions

View File

@ -0,0 +1,28 @@
import pytest
from core.tests.functional.centurion_abstract.test_functional_centurion_abstract_model import (
CenturionAbstractModelInheritedCases
)
@pytest.mark.model_knowledgebase
class knowledgeBaseModelTestCases(
CenturionAbstractModelInheritedCases
):
pass
class knowledgeBaseModelInheritedCases(
knowledgeBaseModelTestCases,
):
pass
@pytest.mark.module_assistance
class knowledgeBaseModelPyTest(
knowledgeBaseModelTestCases,
):
pass

View File

@ -88,7 +88,7 @@ class KnowledgeBaseModelTestCases(
'unique': False,
},
'responsible_user': {
'blank': False,
'blank': True,
'default': models.fields.NOT_PROVIDED,
'field_type': models.ForeignKey,
'null': True,

View File

@ -25,7 +25,7 @@ class Index(IndexViewset):
return Response(
{
"knowledge_base": reverse('v2:_api_v2_knowledge_base-list', request=request),
"knowledge_base": reverse('v2:_api_knowledgebase-list', request=request),
"request": reverse('v2:_api_v2_ticket_request-list', request=request),
}
)

View File

@ -39,7 +39,7 @@ class CenturionAbstractModelTestCases(
assert history_model.__name__ == model().get_history_model_name()
@pytest.mark.skip( reason = 'test must be as part of serializer and viewset tests, not model' )
def test_model_create_has_history_entry(self, model_contenttype, created_model, model):
"""Model Created

View File

@ -16,17 +16,6 @@ class GitGroupModelTestCases(
):
@pytest.mark.skip( reason = 'test must be as part of serializer and viewset tests, not model' )
def test_model_create_has_history_entry(self, model_contenttype, created_model, model):
"""Model Created
Ensure that the model when created, added a `create` Audit History
entry.
"""
pass
def test_model_create_with_parent_sets_tenancy(self, created_model, model, model_kwargs):
"""Model Created