Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Correct sorting of import statements.
  • Loading branch information
lovelydinosaur committed Jun 1, 2016
commit c65c5e4b2c962c4021eab958dc0874bbe1d19377
2 changes: 1 addition & 1 deletion tests/browsable_api/test_browsable_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import unicode_literals

from django.contrib.auth.models import User
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings

from rest_framework.test import APIClient

Expand Down
2 changes: 1 addition & 1 deletion tests/test_atomic_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
from django.http import Http404
from django.test import TestCase, TransactionTestCase
from django.utils.decorators import method_decorator
from tests.models import BasicModel

from rest_framework import status
from rest_framework.exceptions import APIException
from rest_framework.response import Response
from rest_framework.test import APIRequestFactory
from rest_framework.views import APIView
from tests.models import BasicModel

factory = APIRequestFactory()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.contrib.auth.models import User
from django.db import models
from django.http import HttpResponse
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings
from django.utils import six

from rest_framework import (
Expand Down
6 changes: 3 additions & 3 deletions tests/test_generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from django.shortcuts import get_object_or_404
from django.test import TestCase
from django.utils import six
from tests.models import (
BasicModel, ForeignKeySource, ForeignKeyTarget, RESTFrameworkModel
)

from rest_framework import generics, renderers, serializers, status
from rest_framework.response import Response
from rest_framework.test import APIRequestFactory
from tests.models import (
BasicModel, ForeignKeySource, ForeignKeyTarget, RESTFrameworkModel
)

factory = APIRequestFactory()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_htmlrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.template import Template, TemplateDoesNotExist
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings
from django.utils import six

from rest_framework import status
Expand Down
2 changes: 1 addition & 1 deletion tests/test_multitable_inheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from django.db import models
from django.test import TestCase
from tests.models import RESTFrameworkModel

from rest_framework import serializers
from tests.models import RESTFrameworkModel


# Models
Expand Down
2 changes: 1 addition & 1 deletion tests/test_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.core.urlresolvers import ResolverMatch
from django.db import models
from django.test import TestCase
from tests.models import BasicModel

from rest_framework import (
HTTP_HEADER_ENCODING, authentication, generics, permissions, serializers,
Expand All @@ -16,7 +17,6 @@
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()

Expand Down
8 changes: 4 additions & 4 deletions tests/test_relations_hyperlink.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from __future__ import unicode_literals

from django.conf.urls import url
from django.test import override_settings, TestCase

from rest_framework import serializers
from rest_framework.test import APIRequestFactory
from django.test import TestCase, override_settings
from tests.models import (
ForeignKeySource, ForeignKeyTarget, ManyToManySource, ManyToManyTarget,
NullableForeignKeySource, NullableOneToOneSource, OneToOneTarget
)

from rest_framework import serializers
from rest_framework.test import APIRequestFactory

factory = APIRequestFactory()
request = factory.get('/') # Just to ensure we have a request in the serializer context

Expand Down
4 changes: 2 additions & 2 deletions tests/test_relations_pk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from django.test import TestCase
from django.utils import six

from rest_framework import serializers
from tests.models import (
ForeignKeySource, ForeignKeyTarget, ManyToManySource, ManyToManyTarget,
NullableForeignKeySource, NullableOneToOneSource,
NullableUUIDForeignKeySource, OneToOneTarget, UUIDForeignKeyTarget
)

from rest_framework import serializers


# ManyToMany
class ManyToManyTargetSerializer(serializers.ModelSerializer):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_relations_slug.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.test import TestCase

from rest_framework import serializers
from tests.models import (
ForeignKeySource, ForeignKeyTarget, NullableForeignKeySource
)

from rest_framework import serializers


class ForeignKeyTargetSerializer(serializers.ModelSerializer):
sources = serializers.SlugRelatedField(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.conf.urls import include, url
from django.core.cache import cache
from django.db import models
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings
from django.utils import six
from django.utils.safestring import SafeText
from django.utils.translation import ugettext_lazy as _
Expand Down
2 changes: 1 addition & 1 deletion tests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings
from django.utils import six

from rest_framework import status
Expand Down
4 changes: 2 additions & 2 deletions tests/test_response.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import unicode_literals

from django.conf.urls import include, url
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings
from django.utils import six
from tests.models import BasicModel

from rest_framework import generics, routers, serializers, status, viewsets
from rest_framework.parsers import JSONParser
Expand All @@ -11,7 +12,6 @@
)
from rest_framework.response import Response
from rest_framework.views import APIView
from tests.models import BasicModel


# Serializer used to test BasicModel
Expand Down
2 changes: 1 addition & 1 deletion tests/test_reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.conf.urls import url
from django.core.urlresolvers import NoReverseMatch
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings

from rest_framework.reverse import reverse
from rest_framework.test import APIRequestFactory
Expand Down
2 changes: 1 addition & 1 deletion tests/test_routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.conf.urls import include, url
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings

from rest_framework import permissions, serializers, viewsets
from rest_framework.decorators import detail_route, list_route
Expand Down
2 changes: 1 addition & 1 deletion tests/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.conf.urls import url
from django.contrib.auth.models import User
from django.shortcuts import redirect
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings

from rest_framework.decorators import api_view
from rest_framework.response import Response
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from django.conf.urls import url
from django.core.exceptions import ImproperlyConfigured
from django.test import override_settings, TestCase
from django.test import TestCase, override_settings
from django.utils import six
from tests.models import BasicModel

import rest_framework.utils.model_meta
from rest_framework.utils.breadcrumbs import get_breadcrumbs
from rest_framework.utils.model_meta import _resolve_model
from rest_framework.views import APIView
from tests.models import BasicModel


class Root(APIView):
Expand Down