test(access): Functional MetaData Test Suite Company model
ref: #761 #760
This commit is contained in:
24
app/access/tests/functional/company/conftest.py
Normal file
24
app/access/tests/functional/company/conftest.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
|
from access.models.company_base import Company
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture( scope = 'class')
|
||||||
|
def model(request):
|
||||||
|
|
||||||
|
request.cls.model = Company
|
||||||
|
|
||||||
|
yield request.cls.model
|
||||||
|
|
||||||
|
del request.cls.model
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='function')
|
||||||
|
def create_serializer():
|
||||||
|
|
||||||
|
from access.serializers.entity_company import ModelSerializer
|
||||||
|
|
||||||
|
|
||||||
|
yield ModelSerializer
|
@ -0,0 +1,72 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
from access.models.company_base import Company
|
||||||
|
from access.tests.functional.entity.test_functional_entity_metadata import (
|
||||||
|
EntityMetadataInheritedCases
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class CompanyMetadataTestCases(
|
||||||
|
EntityMetadataInheritedCases,
|
||||||
|
):
|
||||||
|
|
||||||
|
add_data: dict = {
|
||||||
|
'name': 'Ian1'
|
||||||
|
}
|
||||||
|
|
||||||
|
kwargs_create_item: dict = {
|
||||||
|
'name': 'Ian2',
|
||||||
|
}
|
||||||
|
|
||||||
|
kwargs_create_item_diff_org: dict = {
|
||||||
|
'name': 'Ian3',
|
||||||
|
}
|
||||||
|
|
||||||
|
model = Company
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class CompanyMetadataInheritedCases(
|
||||||
|
CompanyMetadataTestCases,
|
||||||
|
):
|
||||||
|
|
||||||
|
model = None
|
||||||
|
|
||||||
|
kwargs_create_item: dict = {}
|
||||||
|
|
||||||
|
kwargs_create_item_diff_org: dict = {}
|
||||||
|
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpTestData(self):
|
||||||
|
|
||||||
|
self.kwargs_create_item = {
|
||||||
|
**super().kwargs_create_item,
|
||||||
|
**self.kwargs_create_item
|
||||||
|
}
|
||||||
|
|
||||||
|
self.kwargs_create_item_diff_org = {
|
||||||
|
**super().kwargs_create_item_diff_org,
|
||||||
|
**self.kwargs_create_item_diff_org
|
||||||
|
}
|
||||||
|
|
||||||
|
# self.url_kwargs = {
|
||||||
|
# 'entity_model': self.model._meta.sub_model_type
|
||||||
|
# }
|
||||||
|
|
||||||
|
# self.url_view_kwargs = {
|
||||||
|
# 'entity_model': self.model._meta.sub_model_type
|
||||||
|
# }
|
||||||
|
|
||||||
|
super().setUpTestData()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class CompanyMetadataTest(
|
||||||
|
CompanyMetadataTestCases,
|
||||||
|
TestCase,
|
||||||
|
|
||||||
|
):
|
||||||
|
pass
|
Reference in New Issue
Block a user