test(human_resources): Refactor Employee model API Fields render test Suite to PyTest
ref: #883 #881
This commit is contained in:
@ -22,3 +22,14 @@ def create_serializer():
|
||||
|
||||
|
||||
yield ModelSerializer
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_kwargs(request, kwargs_employee):
|
||||
|
||||
request.cls.kwargs_create_item = kwargs_employee.copy()
|
||||
|
||||
yield kwargs_employee.copy()
|
||||
|
||||
if hasattr(request.cls, 'kwargs_create_item'):
|
||||
del request.cls.kwargs_create_item
|
||||
|
@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from access.tests.unit.contact.test_unit_contact_api_fields import (
|
||||
from access.tests.functional.contact.test_functional_contact_api_fields import (
|
||||
ContactAPIInheritedCases
|
||||
)
|
||||
|
||||
@ -11,15 +11,14 @@ class EmployeeAPITestCases(
|
||||
ContactAPIInheritedCases,
|
||||
):
|
||||
|
||||
parameterized_test_data = {
|
||||
'employee_number': {
|
||||
'expected': int
|
||||
}
|
||||
}
|
||||
@property
|
||||
def parameterized_api_fields(self):
|
||||
|
||||
kwargs_create_item: dict = {
|
||||
'employee_number': 12345,
|
||||
}
|
||||
return {
|
||||
'employee_number': {
|
||||
'expected': int
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -27,9 +26,7 @@ class EmployeeAPIInheritedCases(
|
||||
EmployeeAPITestCases,
|
||||
):
|
||||
|
||||
kwargs_create_item: dict = None
|
||||
|
||||
model = None
|
||||
pass
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user