Skip to content

Commit

Permalink
fix ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
CorneiZeR committed Oct 18, 2024
1 parent cd0c004 commit 6220500
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/test_viewset_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions tests/testapp/serializers.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -24,13 +24,12 @@ class Meta:
"tags",
)


class SecretFieldSerializer(serializers.ModelSerializer):
secret_external = serializers.CharField(write_only=True)

class Meta:
model = SecretFieldModel
fields = ("title", "secret", "secret_external")

extra_kwargs = {
"secret": {"write_only": True}
}
extra_kwargs = {"secret": {"write_only": True}}
4 changes: 2 additions & 2 deletions tests/testapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/urls.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 6220500

Please sign in to comment.