diff --git a/rest_framework/compat.py b/rest_framework/compat.py index fbb6a2863..fd4950527 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -4,14 +4,13 @@ versions of Django/Python, and compatibility wrappers around optional packages. """ import sys +from collections.abc import Mapping, MutableMapping # noqa from django.conf import settings from django.core import validators from django.utils import six from django.views.generic import View -from collections.abc import Mapping, MutableMapping # noqa - try: from django.urls import ( # noqa URLPattern, diff --git a/tests/test_permissions.py b/tests/test_permissions.py index c53dae18b..04fb3700f 100644 --- a/tests/test_permissions.py +++ b/tests/test_permissions.py @@ -8,7 +8,6 @@ from django.contrib.auth.models import AnonymousUser, Group, Permission, User from django.db import models from django.test import TestCase from django.urls import ResolverMatch -from tests.models import BasicModel from rest_framework import ( HTTP_HEADER_ENCODING, RemovedInDRF310Warning, authentication, generics, @@ -19,6 +18,8 @@ from rest_framework.filters import DjangoObjectPermissionsFilter from rest_framework.routers import DefaultRouter from rest_framework.test import APIRequestFactory +from tests.models import BasicModel + factory = APIRequestFactory() diff --git a/tests/test_utils.py b/tests/test_utils.py index 17c1a9bef..996b3c8af 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,5 @@ from django.conf.urls import url from django.test import TestCase, override_settings -from tests.models import BasicModel from rest_framework.decorators import action from rest_framework.routers import SimpleRouter @@ -11,6 +10,8 @@ from rest_framework.utils.urls import remove_query_param, replace_query_param from rest_framework.views import APIView from rest_framework.viewsets import ModelViewSet +from tests.models import BasicModel + class Root(APIView): pass