diff --git a/tests/test_viewset_mixin.py b/tests/test_viewset_mixin.py index 3b1d3ff..7799258 100644 --- a/tests/test_viewset_mixin.py +++ b/tests/test_viewset_mixin.py @@ -4,7 +4,7 @@ from rest_framework.test import APIClient from time_machine import TimeMachineFixture -from tests.testapp.models import ExampleModel, AllFieldsModel, Tag, SecretFieldModel +from tests.testapp.models import AllFieldsModel, ExampleModel, SecretFieldModel, Tag pytestmark = pytest.mark.django_db diff --git a/tests/testapp/serializers.py b/tests/testapp/serializers.py index b6cab19..e433822 100644 --- a/tests/testapp/serializers.py +++ b/tests/testapp/serializers.py @@ -1,6 +1,6 @@ from rest_framework import serializers -from .models import ExampleModel, AllFieldsModel, SecretFieldModel +from .models import AllFieldsModel, ExampleModel, SecretFieldModel class ExampleSerializer(serializers.ModelSerializer): @@ -24,6 +24,7 @@ class Meta: "tags", ) + class SecretFieldSerializer(serializers.ModelSerializer): secret_external = serializers.CharField(write_only=True) @@ -31,6 +32,4 @@ class Meta: model = SecretFieldModel fields = ("title", "secret", "secret_external") - extra_kwargs = { - "secret": {"write_only": True} - } + extra_kwargs = {"secret": {"write_only": True}} diff --git a/tests/testapp/views.py b/tests/testapp/views.py index 06b0354..71b7038 100644 --- a/tests/testapp/views.py +++ b/tests/testapp/views.py @@ -3,8 +3,8 @@ from drf_excel.mixins import XLSXFileMixin from drf_excel.renderers import XLSXRenderer -from .models import ExampleModel, AllFieldsModel, SecretFieldModel -from .serializers import ExampleSerializer, AllFieldsSerializer, SecretFieldSerializer +from .models import AllFieldsModel, ExampleModel, SecretFieldModel +from .serializers import AllFieldsSerializer, ExampleSerializer, SecretFieldSerializer class ExampleViewSet(XLSXFileMixin, ReadOnlyModelViewSet): diff --git a/tests/urls.py b/tests/urls.py index b4ed812..d875c66 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,6 +1,6 @@ from rest_framework import routers -from .testapp.views import ExampleViewSet, AllFieldsViewSet, SecretFieldViewSet +from .testapp.views import AllFieldsViewSet, ExampleViewSet, SecretFieldViewSet router = routers.SimpleRouter() router.register(r"examples", ExampleViewSet)