diff --git a/codeforlife/tests/model_serializer.py b/codeforlife/tests/model_serializer.py index cf87536e..e077feae 100644 --- a/codeforlife/tests/model_serializer.py +++ b/codeforlife/tests/model_serializer.py @@ -10,7 +10,6 @@ from unittest.case import _AssertRaisesContext from django.db.models import Model -from django.forms.models import model_to_dict from rest_framework.serializers import BaseSerializer, ValidationError from ..serializers import ModelListSerializer, ModelSerializer @@ -151,9 +150,9 @@ def _assert_many( assert len(new_data) == len(validated_data) kwargs.pop("many", None) # many must be True - serializer: ModelListSerializer[ - RequestUser, AnyModel - ] = self._init_model_serializer(*args, **kwargs, many=True) + serializer: ModelListSerializer[RequestUser, AnyModel] = ( + self._init_model_serializer(*args, **kwargs, many=True) + ) models = get_models(serializer, deepcopy(validated_data)) assert len(models) == len(validated_data) diff --git a/codeforlife/tests/model_view_set.py b/codeforlife/tests/model_view_set.py index fe59186a..4ce34499 100644 --- a/codeforlife/tests/model_view_set.py +++ b/codeforlife/tests/model_view_set.py @@ -614,9 +614,9 @@ class ModelViewSetTestCase( basename: str model_view_set_class: t.Type[ModelViewSet[RequestUser, AnyModel]] client: ModelViewSetClient[RequestUser, AnyModel] - client_class: t.Type[ - ModelViewSetClient[RequestUser, AnyModel] - ] = ModelViewSetClient + client_class: t.Type[ModelViewSetClient[RequestUser, AnyModel]] = ( + ModelViewSetClient + ) @classmethod def get_model_class(cls) -> t.Type[AnyModel]: