refactor(access): API Metadata Functional Test Suite re-written to Pytest for model Tenant
ref: #942 #899
This commit is contained in:
25
app/access/tests/functional/tenant/conftest.py
Normal file
25
app/access/tests/functional/tenant/conftest.py
Normal file
@ -0,0 +1,25 @@
|
||||
import pytest
|
||||
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model(model_tenant):
|
||||
|
||||
yield model_tenant
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class', autouse = True)
|
||||
def model_kwargs(request, kwargs_tenant):
|
||||
|
||||
request.cls.kwargs_create_item = kwargs_tenant.copy()
|
||||
|
||||
yield kwargs_tenant.copy()
|
||||
|
||||
if hasattr(request.cls, 'kwargs_create_item'):
|
||||
del request.cls.kwargs_create_item
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_serializer(serializer_tenant):
|
||||
|
||||
yield serializer_tenant
|
@ -16,6 +16,7 @@ User = django.contrib.auth.get_user_model()
|
||||
|
||||
|
||||
|
||||
@pytest.mark.model_tenant
|
||||
class ViewSetBase:
|
||||
|
||||
model = Organization
|
||||
@ -191,16 +192,7 @@ class ViewSetBase:
|
||||
|
||||
|
||||
|
||||
class OrganizationViewSet(
|
||||
ViewSetBase,
|
||||
SerializersTestCases,
|
||||
TestCase
|
||||
):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@pytest.mark.module_access
|
||||
class OrganizationMetadata(
|
||||
ViewSetBase,
|
||||
MetadataAttributesFunctional,
|
Reference in New Issue
Block a user