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

ref: #925 #924
This commit is contained in:
2025-08-02 11:32:16 +09:30
parent 76dfcb8bce
commit cf09a15690

View File

@ -0,0 +1,69 @@
import pytest
# from django.db import models
from rest_framework.relations import Hyperlink
from api.tests.functional.test_functional_api_fields import (
APIFieldsInheritedCases,
)
@pytest.mark.model_software
class SoftwareAPITestCases(
APIFieldsInheritedCases,
):
@property
def parameterized_api_fields(self):
return {
'publisher': {
'expected': dict
},
'publisher.id': {
'expected': int
},
'publisher.display_name': {
'expected': str
},
'publisher.url': {
'expected': Hyperlink
},
'name': {
'expected': str
},
'category': {
'expected': dict
},
'category.id': {
'expected': int
},
'category.display_name': {
'expected': str
},
'category.url': {
'expected': Hyperlink
},
'modified': {
'expected': str
}
}
class SoftwareAPIInheritedCases(
SoftwareAPITestCases,
):
pass
@pytest.mark.module_itam
class SoftwareAPIPyTest(
SoftwareAPITestCases,
):
pass