refactor(settings): API Fields render Functional Test Suite re-written to Pytest for model ExternalLink

ref: #942 #940
This commit is contained in:
2025-08-05 13:17:08 +09:30
parent bf1a60439f
commit 204a20b793

View File

@ -0,0 +1,67 @@
import pytest
from django.db import models
from django.test import Client
from rest_framework.relations import Hyperlink
from api.tests.functional.test_functional_api_fields import (
APIFieldsInheritedCases,
)
@pytest.mark.model_externallink
class ExternalLinkAPITestCases(
APIFieldsInheritedCases,
):
@property
def parameterized_api_fields(self):
return {
'name': {
'expected': str
},
'button_text': {
'expected': str
},
'template': {
'expected': str
},
'colour': {
'expected': str
},
'cluster': {
'expected': bool
},
'devices': {
'expected': bool
},
'service': {
'expected': bool
},
'software': {
'expected': bool
},
'modified': {
'expected': str
}
}
class ExternalLinkAPIInheritedCases(
ExternalLinkAPITestCases,
):
pass
@pytest.mark.module_settings
class ExternalLinkAPIPyTest(
ExternalLinkAPITestCases,
):
pass