refactor(settings): API Metadata Functional Test Suite re-written to Pytest for model UserSettings
ref: #942 #941
This commit is contained in:
25
app/settings/tests/functional/user_settings/conftest.py
Normal file
25
app/settings/tests/functional/user_settings/conftest.py
Normal file
@ -0,0 +1,25 @@
|
||||
import pytest
|
||||
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model(model_usersettings):
|
||||
|
||||
yield model_usersettings
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class', autouse = True)
|
||||
def model_kwargs(request, kwargs_usersettings):
|
||||
|
||||
request.cls.kwargs_create_item = kwargs_usersettings.copy()
|
||||
|
||||
yield kwargs_usersettings.copy()
|
||||
|
||||
if hasattr(request.cls, 'kwargs_create_item'):
|
||||
del request.cls.kwargs_create_item
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_serializer(serializer_usersettings):
|
||||
|
||||
yield serializer_usersettings
|
@ -5,20 +5,11 @@ from django.contrib.auth.models import Permission
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
from django.test import TestCase
|
||||
# from django import urls
|
||||
|
||||
from access.models.tenant import Tenant as Organization
|
||||
from access.models.team import Team
|
||||
from access.models.team_user import TeamUsers
|
||||
|
||||
# from api.tests.abstract.api_permissions_viewset import (
|
||||
# APIPermissionChange,
|
||||
# APIPermissionView
|
||||
# )
|
||||
from api.tests.abstract.api_serializer_viewset import (
|
||||
SerializerChange,
|
||||
SerializerView,
|
||||
)
|
||||
from api.tests.abstract.test_metadata_functional import (
|
||||
MetadataAttributesFunctionalEndpoint,
|
||||
MetadataAttributesFunctionalBase,
|
||||
@ -32,7 +23,6 @@ User = django.contrib.auth.get_user_model()
|
||||
|
||||
|
||||
@pytest.mark.functional
|
||||
@pytest.mark.model_usersettings
|
||||
@pytest.mark.module_settings
|
||||
class ViewSetBase:
|
||||
|
||||
@ -198,17 +188,7 @@ class ViewSetBase:
|
||||
|
||||
|
||||
|
||||
class UserSettingsViewSet(
|
||||
ViewSetBase,
|
||||
SerializerChange,
|
||||
SerializerView,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@pytest.mark.model_usersettings
|
||||
class UserSettingsMetadata(
|
||||
ViewSetBase,
|
||||
MetadataAttributesFunctionalEndpoint,
|
Reference in New Issue
Block a user