diff --git a/rest_framework/compat.py b/rest_framework/compat.py index b85e2b965..389501730 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -67,14 +67,6 @@ except ImportError: from django.utils.datastructures import SortedDict as OrderedDict -# unittest.SkipUnless only available in Python 2.7. -try: - import unittest - unittest.skipUnless -except (ImportError, AttributeError): - from django.utils import unittest - - # contrib.postgres only supported from 1.8 onwards. try: from django.contrib.postgres import fields as postgres_fields diff --git a/tests/test_atomic_requests.py b/tests/test_atomic_requests.py index 2d973cb8a..316c8832a 100644 --- a/tests/test_atomic_requests.py +++ b/tests/test_atomic_requests.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals +import unittest + from django.conf.urls import url from django.db import connection, connections, transaction from django.http import Http404 @@ -7,7 +9,6 @@ from django.test import TestCase, TransactionTestCase from django.utils.decorators import method_decorator from rest_framework import status -from rest_framework.compat import unittest from rest_framework.exceptions import APIException from rest_framework.response import Response from rest_framework.test import APIRequestFactory diff --git a/tests/test_filters.py b/tests/test_filters.py index bce6e08fa..729a7b75b 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import datetime +import unittest from decimal import Decimal from django.conf.urls import url @@ -12,7 +13,7 @@ from django.utils.dateparse import parse_date from django.utils.six.moves import reload_module from rest_framework import filters, generics, serializers, status -from rest_framework.compat import django_filters, unittest +from rest_framework.compat import django_filters from rest_framework.test import APIRequestFactory from .models import BaseFilterableItem, BasicModel, FilterableItem diff --git a/tests/test_permissions.py b/tests/test_permissions.py index f0d77e957..e04c72ec9 100644 --- a/tests/test_permissions.py +++ b/tests/test_permissions.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import base64 +import unittest from django.contrib.auth.models import Group, Permission, User from django.core.urlresolvers import ResolverMatch @@ -11,7 +12,7 @@ from rest_framework import ( HTTP_HEADER_ENCODING, authentication, generics, permissions, serializers, status ) -from rest_framework.compat import guardian, unittest +from rest_framework.compat import guardian from rest_framework.filters import DjangoObjectPermissionsFilter from rest_framework.routers import DefaultRouter from rest_framework.test import APIRequestFactory