From 7e874490770857c8f71e1b71fb27c9c737ad631a Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Thu, 25 Oct 2018 13:22:01 +0600 Subject: [PATCH] dropped python 2.7 compat code from tests --- tests/models.py | 2 -- tests/test_api_client.py | 2 -- tests/test_atomic_requests.py | 2 -- tests/test_authentication.py | 4 ---- tests/test_decorators.py | 2 -- tests/test_description.py | 4 ---- tests/test_exceptions.py | 3 --- tests/test_filters.py | 2 -- tests/test_generics.py | 2 -- tests/test_htmlrenderer.py | 2 -- tests/test_metadata.py | 2 -- tests/test_model_serializer.py | 2 -- tests/test_multitable_inheritance.py | 2 -- tests/test_negotiation.py | 2 -- tests/test_one_to_one_with_inheritance.py | 2 -- tests/test_pagination.py | 3 --- tests/test_parsers.py | 3 --- tests/test_permissions.py | 2 -- tests/test_relations_generic.py | 2 -- tests/test_relations_hyperlink.py | 2 -- tests/test_relations_pk.py | 2 -- tests/test_renderers.py | 3 --- tests/test_request.py | 2 -- tests/test_requests_client.py | 2 -- tests/test_response.py | 2 -- tests/test_reverse.py | 2 -- tests/test_routers.py | 2 -- tests/test_serializer.py | 3 --- tests/test_serializer_bulk_update.py | 2 -- tests/test_settings.py | 2 -- tests/test_status.py | 2 -- tests/test_templatetags.py | 3 --- tests/test_testing.py | 3 --- tests/test_throttling.py | 1 - tests/test_urlpatterns.py | 2 -- tests/test_utils.py | 3 --- tests/test_validation.py | 2 -- tests/test_views.py | 2 -- 38 files changed, 87 deletions(-) diff --git a/tests/models.py b/tests/models.py index 6aeceb934..fc24f4bf0 100644 --- a/tests/models.py +++ b/tests/models.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import uuid from django.db import models diff --git a/tests/test_api_client.py b/tests/test_api_client.py index e4354ec60..74a3579e2 100644 --- a/tests/test_api_client.py +++ b/tests/test_api_client.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import os import tempfile import unittest diff --git a/tests/test_atomic_requests.py b/tests/test_atomic_requests.py index bddd480a5..0e807dec0 100644 --- a/tests/test_atomic_requests.py +++ b/tests/test_atomic_requests.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest from django.conf.urls import url diff --git a/tests/test_authentication.py b/tests/test_authentication.py index f2714acb5..38233eae8 100644 --- a/tests/test_authentication.py +++ b/tests/test_authentication.py @@ -1,7 +1,3 @@ -# coding: utf-8 - -from __future__ import unicode_literals - import base64 import pytest diff --git a/tests/test_decorators.py b/tests/test_decorators.py index 9c6a899bf..aef1a2bc0 100644 --- a/tests/test_decorators.py +++ b/tests/test_decorators.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import pytest from django.test import TestCase diff --git a/tests/test_description.py b/tests/test_description.py index 702e56332..0a23747a4 100644 --- a/tests/test_description.py +++ b/tests/test_description.py @@ -1,7 +1,3 @@ -# -- coding: utf-8 -- - -from __future__ import unicode_literals - from django.test import TestCase from django.utils.encoding import python_2_unicode_compatible diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index ce0ed8514..a21334d84 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.test import RequestFactory, TestCase from django.utils import six, translation from django.utils.translation import ugettext_lazy as _ diff --git a/tests/test_filters.py b/tests/test_filters.py index a7d9a07c1..0303ab2c4 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import datetime import pytest diff --git a/tests/test_generics.py b/tests/test_generics.py index c0ff1c5c4..a7a4a68d2 100644 --- a/tests/test_generics.py +++ b/tests/test_generics.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import pytest from django.db import models from django.http import Http404 diff --git a/tests/test_htmlrenderer.py b/tests/test_htmlrenderer.py index decd25a3f..fdce39f23 100644 --- a/tests/test_htmlrenderer.py +++ b/tests/test_htmlrenderer.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import django.template.loader import pytest from django.conf.urls import url diff --git a/tests/test_metadata.py b/tests/test_metadata.py index fe4ea4b42..e1a1fd352 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import pytest from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models diff --git a/tests/test_model_serializer.py b/tests/test_model_serializer.py index e9ed9957f..378a4681e 100644 --- a/tests/test_model_serializer.py +++ b/tests/test_model_serializer.py @@ -5,8 +5,6 @@ shortcuts for automatically creating serializers based on a given model class. These tests deal with ensuring that we correctly map the model fields onto an appropriate set of serializer fields for each case. """ -from __future__ import unicode_literals - import datetime import decimal import sys diff --git a/tests/test_multitable_inheritance.py b/tests/test_multitable_inheritance.py index 2ddd37ebb..1e8ab3448 100644 --- a/tests/test_multitable_inheritance.py +++ b/tests/test_multitable_inheritance.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.db import models from django.test import TestCase diff --git a/tests/test_negotiation.py b/tests/test_negotiation.py index 7ce3f92a9..d74a10063 100644 --- a/tests/test_negotiation.py +++ b/tests/test_negotiation.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import pytest from django.http import Http404 from django.test import TestCase diff --git a/tests/test_one_to_one_with_inheritance.py b/tests/test_one_to_one_with_inheritance.py index 789c7fcb9..40793d7ca 100644 --- a/tests/test_one_to_one_with_inheritance.py +++ b/tests/test_one_to_one_with_inheritance.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.db import models from django.test import TestCase diff --git a/tests/test_pagination.py b/tests/test_pagination.py index d9ad9e6f6..e377beade 100644 --- a/tests/test_pagination.py +++ b/tests/test_pagination.py @@ -1,6 +1,3 @@ -# coding: utf-8 -from __future__ import unicode_literals - import pytest from django.core.paginator import Paginator as DjangoPaginator from django.db import models diff --git a/tests/test_parsers.py b/tests/test_parsers.py index e793948e3..42d49b794 100644 --- a/tests/test_parsers.py +++ b/tests/test_parsers.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - import io import math diff --git a/tests/test_permissions.py b/tests/test_permissions.py index 15fd9303c..14780d104 100644 --- a/tests/test_permissions.py +++ b/tests/test_permissions.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import base64 import unittest import warnings diff --git a/tests/test_relations_generic.py b/tests/test_relations_generic.py index a3798b0a3..3617b7094 100644 --- a/tests/test_relations_generic.py +++ b/tests/test_relations_generic.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation ) diff --git a/tests/test_relations_hyperlink.py b/tests/test_relations_hyperlink.py index 887a6f423..5ad0e31ff 100644 --- a/tests/test_relations_hyperlink.py +++ b/tests/test_relations_hyperlink.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf.urls import url from django.test import TestCase, override_settings diff --git a/tests/test_relations_pk.py b/tests/test_relations_pk.py index 3317d6251..b0cecba35 100644 --- a/tests/test_relations_pk.py +++ b/tests/test_relations_pk.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.test import TestCase from django.utils import six diff --git a/tests/test_renderers.py b/tests/test_renderers.py index a68ece734..07abf8df2 100644 --- a/tests/test_renderers.py +++ b/tests/test_renderers.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - import re from collections import MutableMapping, OrderedDict diff --git a/tests/test_request.py b/tests/test_request.py index 83d295a12..488193cc0 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -1,8 +1,6 @@ """ Tests for content parsing, and form-overloaded content parsing. """ -from __future__ import unicode_literals - import os.path import tempfile diff --git a/tests/test_requests_client.py b/tests/test_requests_client.py index 161429f73..59b388c5a 100644 --- a/tests/test_requests_client.py +++ b/tests/test_requests_client.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest from django.conf.urls import url diff --git a/tests/test_response.py b/tests/test_response.py index e92bf54c1..63d65b4b3 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf.urls import include, url from django.test import TestCase, override_settings from django.utils import six diff --git a/tests/test_reverse.py b/tests/test_reverse.py index 145b1a54f..b9ad48741 100644 --- a/tests/test_reverse.py +++ b/tests/test_reverse.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf.urls import url from django.test import TestCase, override_settings from django.urls import NoReverseMatch diff --git a/tests/test_routers.py b/tests/test_routers.py index eae3f5458..77dc565c1 100644 --- a/tests/test_routers.py +++ b/tests/test_routers.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import warnings from collections import namedtuple diff --git a/tests/test_serializer.py b/tests/test_serializer.py index 0650b7c57..f604301ad 100644 --- a/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -1,6 +1,3 @@ -# coding: utf-8 -from __future__ import unicode_literals - import inspect import pickle import re diff --git a/tests/test_serializer_bulk_update.py b/tests/test_serializer_bulk_update.py index d9e5d7978..82c14bf81 100644 --- a/tests/test_serializer_bulk_update.py +++ b/tests/test_serializer_bulk_update.py @@ -1,8 +1,6 @@ """ Tests to cover bulk create and update using serializers. """ -from __future__ import unicode_literals - from django.test import TestCase from django.utils import six diff --git a/tests/test_settings.py b/tests/test_settings.py index 51e9751b2..b78125ff9 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.test import TestCase, override_settings from rest_framework.settings import APISettings, api_settings diff --git a/tests/test_status.py b/tests/test_status.py index 1cd6e229e..07d893bee 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.test import TestCase from rest_framework.status import ( diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index 5d4f6a4e3..3c9859794 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -1,6 +1,3 @@ -# encoding: utf-8 -from __future__ import unicode_literals - import unittest from django.template import Context, Template diff --git a/tests/test_testing.py b/tests/test_testing.py index 7868f724c..b7fc7e308 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -1,6 +1,3 @@ -# encoding: utf-8 -from __future__ import unicode_literals - from io import BytesIO from django.conf.urls import url diff --git a/tests/test_throttling.py b/tests/test_throttling.py index b220a33a6..6ba916281 100644 --- a/tests/test_throttling.py +++ b/tests/test_throttling.py @@ -1,7 +1,6 @@ """ Tests for the throttling implementations in the permissions module. """ -from __future__ import unicode_literals import pytest from django.contrib.auth.models import User diff --git a/tests/test_urlpatterns.py b/tests/test_urlpatterns.py index 59ba395d2..25cc0032e 100644 --- a/tests/test_urlpatterns.py +++ b/tests/test_urlpatterns.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest from collections import namedtuple diff --git a/tests/test_utils.py b/tests/test_utils.py index 28b06b173..a6f8b9d16 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.conf.urls import url from django.test import TestCase, override_settings diff --git a/tests/test_validation.py b/tests/test_validation.py index 8b71693c5..eeac44bbd 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import re from django.core.validators import MaxValueValidator, RegexValidator diff --git a/tests/test_views.py b/tests/test_views.py index f0919e846..cca78e843 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import copy import sys