diff --git a/django/contrib/admindocs/tests/test_fields.py b/django/contrib/admindocs/tests/test_fields.py index b505d2deebc..e8fe0b0caa7 100644 --- a/django/contrib/admindocs/tests/test_fields.py +++ b/django/contrib/admindocs/tests/test_fields.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import unittest diff --git a/django/contrib/comments/views/comments.py b/django/contrib/comments/views/comments.py index befd3260924..a2cbe33c0ef 100644 --- a/django/contrib/comments/views/comments.py +++ b/django/contrib/comments/views/comments.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django import http from django.conf import settings from django.contrib import comments diff --git a/django/contrib/comments/views/moderation.py b/django/contrib/comments/views/moderation.py index 31bb98fa633..484ceac02cd 100644 --- a/django/contrib/comments/views/moderation.py +++ b/django/contrib/comments/views/moderation.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django import template from django.conf import settings from django.contrib import comments diff --git a/django/contrib/formtools/tests/urls.py b/django/contrib/formtools/tests/urls.py index f96f89ecdfa..c86a7408e04 100644 --- a/django/contrib/formtools/tests/urls.py +++ b/django/contrib/formtools/tests/urls.py @@ -2,8 +2,6 @@ This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only. """ -from __future__ import absolute_import - from django.conf.urls import patterns, url from django.contrib.formtools.tests.tests import TestFormPreview diff --git a/django/contrib/gis/geoip/__init__.py b/django/contrib/gis/geoip/__init__.py index 8b519a242d0..c42dd2c72b4 100644 --- a/django/contrib/gis/geoip/__init__.py +++ b/django/contrib/gis/geoip/__init__.py @@ -11,8 +11,6 @@ Grab GeoIP.dat.gz and GeoLiteCity.dat.gz, and unzip them in the directory corresponding to settings.GEOIP_PATH. """ -from __future__ import absolute_import - try: from .base import GeoIP, GeoIPException HAS_GEOIP = True diff --git a/django/contrib/gis/tests/distapp/tests.py b/django/contrib/gis/tests/distapp/tests.py index 8915f01e508..5e74225f916 100644 --- a/django/contrib/gis/tests/distapp/tests.py +++ b/django/contrib/gis/tests/distapp/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from unittest import skipUnless diff --git a/django/contrib/gis/tests/geo3d/tests.py b/django/contrib/gis/tests/geo3d/tests.py index 6c17003982b..6fdf67042b1 100644 --- a/django/contrib/gis/tests/geo3d/tests.py +++ b/django/contrib/gis/tests/geo3d/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import os import re diff --git a/django/contrib/gis/tests/geoadmin/tests.py b/django/contrib/gis/tests/geoadmin/tests.py index df4158bb31e..295c1de46fa 100644 --- a/django/contrib/gis/tests/geoadmin/tests.py +++ b/django/contrib/gis/tests/geoadmin/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from unittest import skipUnless diff --git a/django/contrib/gis/tests/geoapp/feeds.py b/django/contrib/gis/tests/geoapp/feeds.py index f53431c24d8..9ec959ecce2 100644 --- a/django/contrib/gis/tests/geoapp/feeds.py +++ b/django/contrib/gis/tests/geoapp/feeds.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.contrib.gis import feeds diff --git a/django/contrib/gis/tests/geoapp/sitemaps.py b/django/contrib/gis/tests/geoapp/sitemaps.py index 0e85fda6625..55bf7c764c2 100644 --- a/django/contrib/gis/tests/geoapp/sitemaps.py +++ b/django/contrib/gis/tests/geoapp/sitemaps.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap from .feeds import feed_dict diff --git a/django/contrib/gis/tests/geoapp/test_feeds.py b/django/contrib/gis/tests/geoapp/test_feeds.py index b2953b4a70a..9c7b572e998 100644 --- a/django/contrib/gis/tests/geoapp/test_feeds.py +++ b/django/contrib/gis/tests/geoapp/test_feeds.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from unittest import skipUnless from xml.dom import minidom diff --git a/django/contrib/gis/tests/geoapp/test_regress.py b/django/contrib/gis/tests/geoapp/test_regress.py index 2ffbaec9a97..844f03aef52 100644 --- a/django/contrib/gis/tests/geoapp/test_regress.py +++ b/django/contrib/gis/tests/geoapp/test_regress.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from datetime import datetime from unittest import skipUnless diff --git a/django/contrib/gis/tests/geoapp/test_sitemaps.py b/django/contrib/gis/tests/geoapp/test_sitemaps.py index 98cd8cc5acd..bb68039bc35 100644 --- a/django/contrib/gis/tests/geoapp/test_sitemaps.py +++ b/django/contrib/gis/tests/geoapp/test_sitemaps.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from io import BytesIO from unittest import skipUnless diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py index eabc5958c0b..9221f992854 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import re import unittest diff --git a/django/contrib/gis/tests/geoapp/urls.py b/django/contrib/gis/tests/geoapp/urls.py index 55a5fa3670a..70db62d71be 100644 --- a/django/contrib/gis/tests/geoapp/urls.py +++ b/django/contrib/gis/tests/geoapp/urls.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.conf.urls import patterns diff --git a/django/contrib/gis/tests/geogapp/tests.py b/django/contrib/gis/tests/geogapp/tests.py index 2a60f623fa3..bc809bdfc08 100644 --- a/django/contrib/gis/tests/geogapp/tests.py +++ b/django/contrib/gis/tests/geogapp/tests.py @@ -1,7 +1,7 @@ """ Tests for geography support in PostGIS 1.5+ """ -from __future__ import absolute_import +from __future__ import unicode_literals import os from unittest import skipUnless diff --git a/django/contrib/gis/tests/inspectapp/tests.py b/django/contrib/gis/tests/inspectapp/tests.py index 34dab1ab7de..4b7c5ff21dd 100644 --- a/django/contrib/gis/tests/inspectapp/tests.py +++ b/django/contrib/gis/tests/inspectapp/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import os from unittest import skipUnless diff --git a/django/contrib/gis/tests/layermap/tests.py b/django/contrib/gis/tests/layermap/tests.py index c4c27b353e2..86b15b24d41 100644 --- a/django/contrib/gis/tests/layermap/tests.py +++ b/django/contrib/gis/tests/layermap/tests.py @@ -1,5 +1,5 @@ # coding: utf-8 -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from copy import copy from decimal import Decimal diff --git a/django/contrib/gis/tests/relatedapp/tests.py b/django/contrib/gis/tests/relatedapp/tests.py index 653bda8aaf0..83da000f82d 100644 --- a/django/contrib/gis/tests/relatedapp/tests.py +++ b/django/contrib/gis/tests/relatedapp/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from unittest import skipUnless diff --git a/django/contrib/messages/__init__.py b/django/contrib/messages/__init__.py index 68a53d996f8..a835f29dc9d 100644 --- a/django/contrib/messages/__init__.py +++ b/django/contrib/messages/__init__.py @@ -1,4 +1,2 @@ -from __future__ import absolute_import - from django.contrib.messages.api import * from django.contrib.messages.constants import * diff --git a/django/core/cache/utils.py b/django/core/cache/utils.py index 4310825ad48..b9806cc5e0f 100644 --- a/django/core/cache/utils.py +++ b/django/core/cache/utils.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import hashlib from django.utils.encoding import force_bytes diff --git a/django/core/management/utils.py b/django/core/management/utils.py index 7159d1123f5..d1052d51824 100644 --- a/django/core/management/utils.py +++ b/django/core/management/utils.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import os from subprocess import PIPE, Popen diff --git a/django/core/serializers/json.py b/django/core/serializers/json.py index 64357bf9d55..b07aa3392cc 100644 --- a/django/core/serializers/json.py +++ b/django/core/serializers/json.py @@ -4,6 +4,7 @@ Serialize data to/from JSON # Avoid shadowing the standard library json module from __future__ import absolute_import +from __future__ import unicode_literals import datetime import decimal diff --git a/django/db/models/sql/__init__.py b/django/db/models/sql/__init__.py index df5b74e3265..8bc60c1d107 100644 --- a/django/db/models/sql/__init__.py +++ b/django/db/models/sql/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.subqueries import * from django.db.models.sql.query import * diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index 2e83ecdce48..7b71580370a 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -2,8 +2,6 @@ Code to manage the creation and SQL rendering of 'where' constraints. """ -from __future__ import absolute_import - import collections import datetime from itertools import repeat diff --git a/django/forms/__init__.py b/django/forms/__init__.py index 2588098330d..34896d948dd 100644 --- a/django/forms/__init__.py +++ b/django/forms/__init__.py @@ -2,8 +2,6 @@ Django validation and HTML form handling. """ -from __future__ import absolute_import - from django.core.exceptions import ValidationError from django.forms.fields import * from django.forms.forms import * diff --git a/django/forms/extras/__init__.py b/django/forms/extras/__init__.py index d801e4fa807..28316f472c5 100644 --- a/django/forms/extras/__init__.py +++ b/django/forms/extras/__init__.py @@ -1,3 +1 @@ -from __future__ import absolute_import - from django.forms.extras.widgets import * diff --git a/django/forms/fields.py b/django/forms/fields.py index a794c02e9fc..de0c620ed06 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -2,7 +2,7 @@ Field classes. """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import copy import datetime diff --git a/django/forms/forms.py b/django/forms/forms.py index ad5daf44162..31e51e7c340 100644 --- a/django/forms/forms.py +++ b/django/forms/forms.py @@ -2,7 +2,7 @@ Form classes """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import copy import warnings diff --git a/django/forms/formsets.py b/django/forms/formsets.py index cb3126e6d7d..8a379ff3cfa 100644 --- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.forms import Form diff --git a/django/forms/models.py b/django/forms/models.py index 2d1ec963067..83954b0b22a 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -3,7 +3,7 @@ Helper functions for creating Form classes from Django models and database field objects. """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import warnings diff --git a/django/forms/widgets.py b/django/forms/widgets.py index a92e5a56cef..8a351bb637a 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -2,7 +2,7 @@ HTML Widget classes """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import copy from itertools import chain diff --git a/django/http/cookie.py b/django/http/cookie.py index 50ff549caf3..62d5c61a4de 100644 --- a/django/http/cookie.py +++ b/django/http/cookie.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.utils.encoding import force_str from django.utils import six diff --git a/django/http/request.py b/django/http/request.py index b7f9d241a7f..e222081450b 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import copy import os diff --git a/django/http/response.py b/django/http/response.py index 1f0849c0bf5..07bbd32eeb5 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime import time diff --git a/django/template/base.py b/django/template/base.py index aa82d8911ad..ed4196012a0 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import re from functools import partial diff --git a/tests/admin_changelist/admin.py b/tests/admin_changelist/admin.py index 175b1972c93..db836cdf7dc 100644 --- a/tests/admin_changelist/admin.py +++ b/tests/admin_changelist/admin.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib import admin from django.core.paginator import Paginator diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index fb72f60b7c0..a65de464907 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py index 31c93410f4c..257638afb17 100644 --- a/tests/admin_custom_urls/tests.py +++ b/tests/admin_custom_urls/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import warnings from django.contrib.admin.util import quote diff --git a/tests/admin_docs/urls.py b/tests/admin_docs/urls.py index 3c3a8fe5d8f..914b4836e0b 100644 --- a/tests/admin_docs/urls.py +++ b/tests/admin_docs/urls.py @@ -1,6 +1,3 @@ -# coding: utf-8 -from __future__ import absolute_import - from django.conf.urls import patterns from . import views diff --git a/tests/admin_filters/tests.py b/tests/admin_filters/tests.py index f05e8e2011a..5e6b122fecb 100644 --- a/tests/admin_filters/tests.py +++ b/tests/admin_filters/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime diff --git a/tests/admin_inlines/admin.py b/tests/admin_inlines/admin.py index 62f9e04e5bb..c69800851a7 100644 --- a/tests/admin_inlines/admin.py +++ b/tests/admin_inlines/admin.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib import admin from django import forms diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index 465b224d4f0..f62a0c1e01a 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.contrib.admin.helpers import InlineAdminForm diff --git a/tests/admin_inlines/urls.py b/tests/admin_inlines/urls.py index cf18ef97cf1..a5d927e20b8 100644 --- a/tests/admin_inlines/urls.py +++ b/tests/admin_inlines/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, include from . import admin diff --git a/tests/admin_ordering/tests.py b/tests/admin_ordering/tests.py index 6655ad37ad5..763e97bd721 100644 --- a/tests/admin_ordering/tests.py +++ b/tests/admin_ordering/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.test import TestCase, RequestFactory from django.contrib import admin diff --git a/tests/admin_registration/tests.py b/tests/admin_registration/tests.py index 1b2d291691e..0e444fd2af7 100644 --- a/tests/admin_registration/tests.py +++ b/tests/admin_registration/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.contrib import admin from django.core.exceptions import ImproperlyConfigured diff --git a/tests/admin_scripts/complex_app/admin/foo.py b/tests/admin_scripts/complex_app/admin/foo.py index 1ed704a66bc..09ceba05aa5 100644 --- a/tests/admin_scripts/complex_app/admin/foo.py +++ b/tests/admin_scripts/complex_app/admin/foo.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib import admin from ..models.foo import Foo diff --git a/tests/admin_scripts/complex_app/models/bar.py b/tests/admin_scripts/complex_app/models/bar.py index 15956f7a50f..92f1b986948 100644 --- a/tests/admin_scripts/complex_app/models/bar.py +++ b/tests/admin_scripts/complex_app/models/bar.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.db import models from ..admin import foo diff --git a/tests/admin_scripts/simple_app/models.py b/tests/admin_scripts/simple_app/models.py index b89f4b898be..e5b9e297c56 100644 --- a/tests/admin_scripts/simple_app/models.py +++ b/tests/admin_scripts/simple_app/models.py @@ -1,3 +1 @@ -from __future__ import absolute_import - from ..complex_app.models.bar import Bar diff --git a/tests/admin_util/tests.py b/tests/admin_util/tests.py index 4a9a203f503..8c63e90ce18 100644 --- a/tests/admin_util/tests.py +++ b/tests/admin_util/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from datetime import datetime diff --git a/tests/admin_validation/tests.py b/tests/admin_validation/tests.py index 5eee3e71051..39e74a945cc 100644 --- a/tests/admin_validation/tests.py +++ b/tests/admin_validation/tests.py @@ -1,9 +1,10 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django import forms from django.contrib import admin from django.core.exceptions import ImproperlyConfigured from django.test import TestCase +from django.test.utils import str_prefix from .models import Song, Book, Album, TwoAlbumFKAndAnE, State, City @@ -185,7 +186,8 @@ class ValidationTestCase(TestCase): readonly_fields = ("title", "nonexistant") self.assertRaisesMessage(ImproperlyConfigured, - "SongAdmin.readonly_fields[1], 'nonexistant' is not a callable or an attribute of 'SongAdmin' or found in the model 'Song'.", + str_prefix("SongAdmin.readonly_fields[1], %(_)s'nonexistant' is not a callable " + "or an attribute of 'SongAdmin' or found in the model 'Song'."), SongAdmin.validate, Song) @@ -195,7 +197,8 @@ class ValidationTestCase(TestCase): readonly_fields=['i_dont_exist'] # Missing attribute self.assertRaisesMessage(ImproperlyConfigured, - "CityInline.readonly_fields[0], 'i_dont_exist' is not a callable or an attribute of 'CityInline' or found in the model 'City'.", + str_prefix("CityInline.readonly_fields[0], %(_)s'i_dont_exist' is not a callable " + "or an attribute of 'CityInline' or found in the model 'City'."), CityInline.validate, City) diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py index 039abb819be..df8ced949e5 100644 --- a/tests/admin_views/admin.py +++ b/tests/admin_views/admin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import tempfile import os diff --git a/tests/admin_views/customadmin.py b/tests/admin_views/customadmin.py index c204b81edd0..ed3a3dea7ad 100644 --- a/tests/admin_views/customadmin.py +++ b/tests/admin_views/customadmin.py @@ -1,7 +1,7 @@ """ A second, custom AdminSite -- see tests.CustomAdminSiteTests. """ -from __future__ import absolute_import +from __future__ import unicode_literals from django.conf.urls import patterns from django.contrib import admin diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 80fdb904021..19c5207cf9d 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1,5 +1,5 @@ # coding: utf-8 -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import os import re diff --git a/tests/admin_views/urls.py b/tests/admin_views/urls.py index 763c83a450f..d934173234b 100644 --- a/tests/admin_views/urls.py +++ b/tests/admin_views/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, include from . import views, customadmin, admin diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py index e8d4e5276ba..c083c7cb9c8 100644 --- a/tests/admin_widgets/tests.py +++ b/tests/admin_widgets/tests.py @@ -1,5 +1,5 @@ # encoding: utf-8 -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from datetime import datetime, timedelta from unittest import TestCase diff --git a/tests/admin_widgets/urls.py b/tests/admin_widgets/urls.py index aecee90b7f0..3da5d25bc84 100644 --- a/tests/admin_widgets/urls.py +++ b/tests/admin_widgets/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, include from . import widgetadmin diff --git a/tests/admin_widgets/widgetadmin.py b/tests/admin_widgets/widgetadmin.py index 1cdeeb9f677..b7023fc81c3 100644 --- a/tests/admin_widgets/widgetadmin.py +++ b/tests/admin_widgets/widgetadmin.py @@ -1,8 +1,3 @@ -""" - -""" -from __future__ import absolute_import - from django.contrib import admin from . import models @@ -47,4 +42,4 @@ site.register(models.Bee) site.register(models.Advisor) -site.register(models.School, SchoolAdmin) \ No newline at end of file +site.register(models.School, SchoolAdmin) diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index dd7e994a639..e1a880585f8 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import datetime from decimal import Decimal diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py index 35ac57d9bef..0838cb8fe8d 100644 --- a/tests/aggregation_regress/tests.py +++ b/tests/aggregation_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime import pickle diff --git a/tests/app_loading/tests.py b/tests/app_loading/tests.py index e0c7cbd78c7..bba2b234a23 100644 --- a/tests/app_loading/tests.py +++ b/tests/app_loading/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import copy import os diff --git a/tests/backends/tests.py b/tests/backends/tests.py index ec592f01887..2ad2e1d6d59 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Unit and doctests for specific database backends. -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime from decimal import Decimal diff --git a/tests/basic/tests.py b/tests/basic/tests.py index 9d4490afc62..879c7869fae 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from datetime import datetime import threading diff --git a/tests/bug639/tests.py b/tests/bug639/tests.py index 71c50e14aa1..769d27d2f0b 100644 --- a/tests/bug639/tests.py +++ b/tests/bug639/tests.py @@ -4,8 +4,6 @@ gets called *again* for each FileField. This test will fail if calling a ModelForm's save() method causes Model.save() to be called more than once. """ -from __future__ import absolute_import - import os import shutil import unittest diff --git a/tests/bug8245/admin.py b/tests/bug8245/admin.py index d8211907638..e7d1a080c20 100644 --- a/tests/bug8245/admin.py +++ b/tests/bug8245/admin.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib import admin from .models import Story diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py index d4772934a10..94258ca711c 100644 --- a/tests/bulk_create/tests.py +++ b/tests/bulk_create/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from operator import attrgetter diff --git a/tests/cache/tests.py b/tests/cache/tests.py index bccac6b5a88..a2256665210 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -2,7 +2,7 @@ # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import hashlib import os diff --git a/tests/choices/tests.py b/tests/choices/tests.py index 03a7d3340d8..2d612626c21 100644 --- a/tests/choices/tests.py +++ b/tests/choices/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.test import TestCase from .models import Person diff --git a/tests/comment_tests/tests/__init__.py b/tests/comment_tests/tests/__init__.py index ae4585e187c..6cbddbe82ba 100644 --- a/tests/comment_tests/tests/__init__.py +++ b/tests/comment_tests/tests/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib.auth.models import User from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment diff --git a/tests/comment_tests/tests/test_app_api.py b/tests/comment_tests/tests/test_app_api.py index ed23ba39ccc..83ee868a021 100644 --- a/tests/comment_tests/tests/test_app_api.py +++ b/tests/comment_tests/tests/test_app_api.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf import settings from django.contrib import comments from django.contrib.comments.models import Comment diff --git a/tests/comment_tests/tests/test_comment_form.py b/tests/comment_tests/tests/test_comment_form.py index a30f13a0733..bca339fd3d0 100644 --- a/tests/comment_tests/tests/test_comment_form.py +++ b/tests/comment_tests/tests/test_comment_form.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - import time from django.conf import settings diff --git a/tests/comment_tests/tests/test_comment_utils_moderators.py b/tests/comment_tests/tests/test_comment_utils_moderators.py index 6c7a882e254..e61be48d8b0 100644 --- a/tests/comment_tests/tests/test_comment_utils_moderators.py +++ b/tests/comment_tests/tests/test_comment_utils_moderators.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib.comments.models import Comment from django.contrib.comments.moderation import (moderator, CommentModerator, AlreadyModerated) diff --git a/tests/comment_tests/tests/test_comment_view.py b/tests/comment_tests/tests/test_comment_view.py index 0d994d3af8b..19d7c1d16b3 100644 --- a/tests/comment_tests/tests/test_comment_view.py +++ b/tests/comment_tests/tests/test_comment_view.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import re diff --git a/tests/comment_tests/tests/test_feeds.py b/tests/comment_tests/tests/test_feeds.py index 941ffb6bf2f..e6652afa280 100644 --- a/tests/comment_tests/tests/test_feeds.py +++ b/tests/comment_tests/tests/test_feeds.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from xml.etree import ElementTree as ET from django.conf import settings diff --git a/tests/comment_tests/tests/test_models.py b/tests/comment_tests/tests/test_models.py index 69c1a8118f3..4303fda8523 100644 --- a/tests/comment_tests/tests/test_models.py +++ b/tests/comment_tests/tests/test_models.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib.comments.models import Comment from . import CommentTestCase diff --git a/tests/comment_tests/tests/test_moderation_views.py b/tests/comment_tests/tests/test_moderation_views.py index 02af35cfe46..9f826f58669 100644 --- a/tests/comment_tests/tests/test_moderation_views.py +++ b/tests/comment_tests/tests/test_moderation_views.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.contrib.auth.models import User, Permission from django.contrib.comments import signals diff --git a/tests/comment_tests/tests/test_templatetags.py b/tests/comment_tests/tests/test_templatetags.py index 1971c21a58e..d24859eb55e 100644 --- a/tests/comment_tests/tests/test_templatetags.py +++ b/tests/comment_tests/tests/test_templatetags.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment from django.contrib.contenttypes.models import ContentType diff --git a/tests/comment_tests/urls.py b/tests/comment_tests/urls.py index 0a7e8b5fdf6..32106106b54 100644 --- a/tests/comment_tests/urls.py +++ b/tests/comment_tests/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url from django.contrib.comments.feeds import LatestCommentFeed diff --git a/tests/conditional_processing/views.py b/tests/conditional_processing/views.py index 14a5a83a45c..d4dc4b8cf6c 100644 --- a/tests/conditional_processing/views.py +++ b/tests/conditional_processing/views.py @@ -1,6 +1,3 @@ -# -*- coding:utf-8 -*- -from __future__ import absolute_import - from django.views.decorators.http import condition, etag, last_modified from django.http import HttpResponse diff --git a/tests/contenttypes_tests/models.py b/tests/contenttypes_tests/models.py index 3c6685687a6..5d21ad5b966 100644 --- a/tests/contenttypes_tests/models.py +++ b/tests/contenttypes_tests/models.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible diff --git a/tests/contenttypes_tests/tests.py b/tests/contenttypes_tests/tests.py index b39e118ec6f..63f02697df1 100644 --- a/tests/contenttypes_tests/tests.py +++ b/tests/contenttypes_tests/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.test import TestCase diff --git a/tests/contenttypes_tests/urls.py b/tests/contenttypes_tests/urls.py index 2cfc90b0244..626b3ae8f7f 100644 --- a/tests/contenttypes_tests/urls.py +++ b/tests/contenttypes_tests/urls.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.conf.urls import patterns diff --git a/tests/context_processors/urls.py b/tests/context_processors/urls.py index 757017c9ca9..9340cdfc381 100644 --- a/tests/context_processors/urls.py +++ b/tests/context_processors/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url from . import views diff --git a/tests/custom_columns/tests.py b/tests/custom_columns/tests.py index 51028b0c460..155279297fb 100644 --- a/tests/custom_columns/tests.py +++ b/tests/custom_columns/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase diff --git a/tests/custom_columns_regress/tests.py b/tests/custom_columns_regress/tests.py index 7cc66ca2a68..034de08d455 100644 --- a/tests/custom_columns_regress/tests.py +++ b/tests/custom_columns_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase diff --git a/tests/custom_managers/tests.py b/tests/custom_managers/tests.py index 5ab58b534a4..87e5a721bc8 100644 --- a/tests/custom_managers/tests.py +++ b/tests/custom_managers/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase from django.utils import six diff --git a/tests/custom_managers_regress/tests.py b/tests/custom_managers_regress/tests.py index 5a9cd91d596..8462e526c97 100644 --- a/tests/custom_managers_regress/tests.py +++ b/tests/custom_managers_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/custom_methods/tests.py b/tests/custom_methods/tests.py index 9d7444ba620..addb61d4c1f 100644 --- a/tests/custom_methods/tests.py +++ b/tests/custom_methods/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import date diff --git a/tests/custom_pk/models.py b/tests/custom_pk/models.py index 5ef9b69f0c8..8d5065aed87 100644 --- a/tests/custom_pk/models.py +++ b/tests/custom_pk/models.py @@ -6,7 +6,7 @@ By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.db import models diff --git a/tests/custom_pk/tests.py b/tests/custom_pk/tests.py index 3f562f0bed8..59bc64754ff 100644 --- a/tests/custom_pk/tests.py +++ b/tests/custom_pk/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.db import transaction, IntegrityError from django.test import TestCase, skipIfDBFeature diff --git a/tests/datatypes/tests.py b/tests/datatypes/tests.py index b6b52dedf26..a2bb0c110a4 100644 --- a/tests/datatypes/tests.py +++ b/tests/datatypes/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime diff --git a/tests/dates/tests.py b/tests/dates/tests.py index 6c02d597dec..c2a8d82e37f 100644 --- a/tests/dates/tests.py +++ b/tests/dates/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import datetime diff --git a/tests/datetimes/tests.py b/tests/datetimes/tests.py index 58cb060f6ba..f54b30d9675 100644 --- a/tests/datetimes/tests.py +++ b/tests/datetimes/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import datetime diff --git a/tests/defer/tests.py b/tests/defer/tests.py index 50db5a76b40..1df312e1bfe 100644 --- a/tests/defer/tests.py +++ b/tests/defer/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db.models.query_utils import DeferredAttribute, InvalidQuery from django.test import TestCase diff --git a/tests/defer_regress/tests.py b/tests/defer_regress/tests.py index ad2546794ca..619f65163cc 100644 --- a/tests/defer_regress/tests.py +++ b/tests/defer_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from operator import attrgetter diff --git a/tests/delete/tests.py b/tests/delete/tests.py index 66173078a0f..8fb16f5a2de 100644 --- a/tests/delete/tests.py +++ b/tests/delete/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db import models, IntegrityError, connection from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature diff --git a/tests/delete_regress/tests.py b/tests/delete_regress/tests.py index a4908b21218..22e15baf8e6 100644 --- a/tests/delete_regress/tests.py +++ b/tests/delete_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import datetime diff --git a/tests/dispatch/tests/__init__.py b/tests/dispatch/tests/__init__.py index b6d26217e11..4c4d4fea8a9 100644 --- a/tests/dispatch/tests/__init__.py +++ b/tests/dispatch/tests/__init__.py @@ -2,7 +2,5 @@ Unit-tests for the dispatch project """ -from __future__ import absolute_import - from .test_dispatcher import DispatcherTests, ReceiverTestCase from .test_saferef import SaferefTests diff --git a/tests/distinct_on_fields/tests.py b/tests/distinct_on_fields/tests.py index f62a32e58d5..7bc06f0da2e 100644 --- a/tests/distinct_on_fields/tests.py +++ b/tests/distinct_on_fields/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db.models import Max from django.test import TestCase, skipUnlessDBFeature diff --git a/tests/empty/tests.py b/tests/empty/tests.py index 6dd9f7c75d3..007d04c363a 100644 --- a/tests/empty/tests.py +++ b/tests/empty/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.core.exceptions import ImproperlyConfigured from django.db.models.loading import get_app from django.test import TestCase diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py index a3514964423..9801d0acbbf 100644 --- a/tests/expressions/tests.py +++ b/tests/expressions/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.core.exceptions import FieldError from django.db.models import F diff --git a/tests/expressions_regress/tests.py b/tests/expressions_regress/tests.py index ddb2c83b4f1..c4f80858044 100644 --- a/tests/expressions_regress/tests.py +++ b/tests/expressions_regress/tests.py @@ -1,7 +1,7 @@ """ Spanning tests for all the operations that F() expressions can perform. """ -from __future__ import absolute_import +from __future__ import unicode_literals import datetime diff --git a/tests/extra_regress/tests.py b/tests/extra_regress/tests.py index 194b250c999..921f33aab99 100644 --- a/tests/extra_regress/tests.py +++ b/tests/extra_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime diff --git a/tests/field_defaults/tests.py b/tests/field_defaults/tests.py index 69dabb51689..d9f28d8c5c6 100644 --- a/tests/field_defaults/tests.py +++ b/tests/field_defaults/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from datetime import datetime from django.test import TestCase diff --git a/tests/field_subclassing/models.py b/tests/field_subclassing/models.py index 642573cc83b..67a95b02f2c 100644 --- a/tests/field_subclassing/models.py +++ b/tests/field_subclassing/models.py @@ -2,8 +2,6 @@ Tests for field subclassing. """ -from __future__ import absolute_import - from django.db import models from django.utils.encoding import force_text diff --git a/tests/field_subclassing/tests.py b/tests/field_subclassing/tests.py index 4945cff1bf0..d3b4d9e5279 100644 --- a/tests/field_subclassing/tests.py +++ b/tests/field_subclassing/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.core import serializers from django.test import TestCase diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index 8cf4c33091b..cdd97203743 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import errno import os diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index f5a9c10be40..b0f00236d2e 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -1,5 +1,5 @@ #! -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import base64 import errno diff --git a/tests/file_uploads/urls.py b/tests/file_uploads/urls.py index 96efaaa5d83..4782a0dab96 100644 --- a/tests/file_uploads/urls.py +++ b/tests/file_uploads/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns from . import views diff --git a/tests/file_uploads/views.py b/tests/file_uploads/views.py index d1bd2cf44e2..8d20a9cb6e8 100644 --- a/tests/file_uploads/views.py +++ b/tests/file_uploads/views.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import hashlib import json diff --git a/tests/files/tests.py b/tests/files/tests.py index 54eeee13e40..b353c1a2134 100644 --- a/tests/files/tests.py +++ b/tests/files/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import os import gzip diff --git a/tests/fixtures/tests.py b/tests/fixtures/tests.py index 6f2218b19ec..78653ffe5ed 100644 --- a/tests/fixtures/tests.py +++ b/tests/fixtures/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import warnings diff --git a/tests/fixtures_regress/models.py b/tests/fixtures_regress/models.py index 1cc30d2e51f..99096728a73 100644 --- a/tests/fixtures_regress/models.py +++ b/tests/fixtures_regress/models.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py index 9899bf939c8..f917b216426 100644 --- a/tests/fixtures_regress/tests.py +++ b/tests/fixtures_regress/tests.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Unittests for fixtures. -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import os import re diff --git a/tests/force_insert_update/tests.py b/tests/force_insert_update/tests.py index a5b2dcebb5c..706a099872f 100644 --- a/tests/force_insert_update/tests.py +++ b/tests/force_insert_update/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db import transaction, IntegrityError, DatabaseError from django.test import TestCase diff --git a/tests/forms_tests/tests/__init__.py b/tests/forms_tests/tests/__init__.py index aea9418c05b..39219f82bee 100644 --- a/tests/forms_tests/tests/__init__.py +++ b/tests/forms_tests/tests/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from .test_error_messages import (FormsErrorMessagesTestCase, ModelChoiceFieldErrorMessagesTestCase) from .test_extra import FormsExtraTestCase, FormsExtraL10NTestCase diff --git a/tests/forms_tests/tests/test_error_messages.py b/tests/forms_tests/tests/test_error_messages.py index 9d45a46a3d1..f0638298e93 100644 --- a/tests/forms_tests/tests/test_error_messages.py +++ b/tests/forms_tests/tests/test_error_messages.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import * diff --git a/tests/forms_tests/tests/test_extra.py b/tests/forms_tests/tests/test_extra.py index d439e2223c3..afdfaf5281a 100644 --- a/tests/forms_tests/tests/test_extra.py +++ b/tests/forms_tests/tests/test_extra.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime diff --git a/tests/forms_tests/tests/tests.py b/tests/forms_tests/tests/tests.py index 99a67c320c5..4c391646e75 100644 --- a/tests/forms_tests/tests/tests.py +++ b/tests/forms_tests/tests/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime diff --git a/tests/generic_inline_admin/admin.py b/tests/generic_inline_admin/admin.py index 73cac7f7c57..1917024fa56 100644 --- a/tests/generic_inline_admin/admin.py +++ b/tests/generic_inline_admin/admin.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib import admin from django.contrib.contenttypes import generic diff --git a/tests/generic_inline_admin/tests.py b/tests/generic_inline_admin/tests.py index ac2c1911836..ccf12ab4f3a 100644 --- a/tests/generic_inline_admin/tests.py +++ b/tests/generic_inline_admin/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.conf import settings from django.contrib import admin diff --git a/tests/generic_inline_admin/urls.py b/tests/generic_inline_admin/urls.py index 88d7b574d4b..8d68d6c9222 100644 --- a/tests/generic_inline_admin/urls.py +++ b/tests/generic_inline_admin/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, include from . import admin diff --git a/tests/generic_relations/tests.py b/tests/generic_relations/tests.py index 734b2e51434..2b52ebac567 100644 --- a/tests/generic_relations/tests.py +++ b/tests/generic_relations/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django import forms from django.contrib.contenttypes.generic import generic_inlineformset_factory diff --git a/tests/generic_views/test_base.py b/tests/generic_views/test_base.py index 013a8f282c7..b1dd7a3040b 100644 --- a/tests/generic_views/test_base.py +++ b/tests/generic_views/test_base.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import time import unittest diff --git a/tests/generic_views/test_dates.py b/tests/generic_views/test_dates.py index bff909f7d0b..03c6d02e5e8 100644 --- a/tests/generic_views/test_dates.py +++ b/tests/generic_views/test_dates.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import time import datetime diff --git a/tests/generic_views/test_detail.py b/tests/generic_views/test_detail.py index 3a97d27995d..8a487a7c3d3 100644 --- a/tests/generic_views/test_detail.py +++ b/tests/generic_views/test_detail.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.test import TestCase diff --git a/tests/generic_views/test_edit.py b/tests/generic_views/test_edit.py index 9ed18833e49..9b1ba0f8656 100644 --- a/tests/generic_views/test_edit.py +++ b/tests/generic_views/test_edit.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import warnings from unittest import expectedFailure diff --git a/tests/generic_views/test_forms.py b/tests/generic_views/test_forms.py index 8c118e32a64..1ee26afc8fc 100644 --- a/tests/generic_views/test_forms.py +++ b/tests/generic_views/test_forms.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django import forms diff --git a/tests/generic_views/test_list.py b/tests/generic_views/test_list.py index a77a6418a38..e572af8e32f 100644 --- a/tests/generic_views/test_list.py +++ b/tests/generic_views/test_list.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.test import TestCase diff --git a/tests/generic_views/urls.py b/tests/generic_views/urls.py index 695b50279ae..4ef8f7a97f4 100644 --- a/tests/generic_views/urls.py +++ b/tests/generic_views/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url from django.views.decorators.cache import cache_page from django.views.generic import TemplateView diff --git a/tests/generic_views/views.py b/tests/generic_views/views.py index fd331f14b76..f839b537532 100644 --- a/tests/generic_views/views.py +++ b/tests/generic_views/views.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator diff --git a/tests/get_earliest_or_latest/tests.py b/tests/get_earliest_or_latest/tests.py index 8d16af95870..eeb95c0818d 100644 --- a/tests/get_earliest_or_latest/tests.py +++ b/tests/get_earliest_or_latest/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import datetime diff --git a/tests/get_object_or_404/tests.py b/tests/get_object_or_404/tests.py index 38ebeb4f8c2..1a0b41bc4d2 100644 --- a/tests/get_object_or_404/tests.py +++ b/tests/get_object_or_404/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.http import Http404 from django.shortcuts import get_object_or_404, get_list_or_404 @@ -87,7 +87,7 @@ class GetObjectOr404Tests(TestCase): self.assertRaisesMessage(ValueError, "Object is of type 'str', but must be a Django Model, Manager, " "or QuerySet", - get_object_or_404, "Article", title__icontains="Run" + get_object_or_404, str("Article"), title__icontains="Run" ) class CustomClass(object): diff --git a/tests/get_or_create/tests.py b/tests/get_or_create/tests.py index 0f766ab1288..a612ea60a06 100644 --- a/tests/get_or_create/tests.py +++ b/tests/get_or_create/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import date import traceback @@ -65,7 +65,7 @@ class GetOrCreateTests(TestCase): ManualPrimaryKeyTest.objects.get_or_create(id=1, data="Different") except IntegrityError as e: formatted_traceback = traceback.format_exc() - self.assertIn('obj.save', formatted_traceback) + self.assertIn(str('obj.save'), formatted_traceback) def test_savepoint_rollback(self): # Regression test for #20463: the database connection should still be diff --git a/tests/get_or_create_regress/tests.py b/tests/get_or_create_regress/tests.py index 92c371b6f80..54dafc85fba 100644 --- a/tests/get_or_create_regress/tests.py +++ b/tests/get_or_create_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/i18n/forms.py b/tests/i18n/forms.py index 6e4def9c5ee..07b015d590f 100644 --- a/tests/i18n/forms.py +++ b/tests/i18n/forms.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django import forms from django.forms.extras import SelectDateWidget diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py index 8e6ec45ce16..3d5cbc590e4 100644 --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime import decimal diff --git a/tests/inline_formsets/tests.py b/tests/inline_formsets/tests.py index ad8a666cb57..a16488dc793 100644 --- a/tests/inline_formsets/tests.py +++ b/tests/inline_formsets/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.forms.models import inlineformset_factory from django.test import TestCase diff --git a/tests/introspection/tests.py b/tests/introspection/tests.py index f1c87bbf147..6f384399457 100644 --- a/tests/introspection/tests.py +++ b/tests/introspection/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import unittest diff --git a/tests/known_related_objects/tests.py b/tests/known_related_objects/tests.py index d28d266557d..6fd507cbdc6 100644 --- a/tests/known_related_objects/tests.py +++ b/tests/known_related_objects/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/lookup/tests.py b/tests/lookup/tests.py index ee9c5afe1d9..c9891c846f2 100644 --- a/tests/lookup/tests.py +++ b/tests/lookup/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from datetime import datetime from operator import attrgetter diff --git a/tests/m2m_and_m2o/tests.py b/tests/m2m_and_m2o/tests.py index 77f2eb3b09a..0380ad4b084 100644 --- a/tests/m2m_and_m2o/tests.py +++ b/tests/m2m_and_m2o/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.db.models import Q from django.test import TestCase diff --git a/tests/m2m_intermediary/tests.py b/tests/m2m_intermediary/tests.py index f261f23546c..d9c77ecb7c7 100644 --- a/tests/m2m_intermediary/tests.py +++ b/tests/m2m_intermediary/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import datetime diff --git a/tests/m2m_multiple/tests.py b/tests/m2m_multiple/tests.py index 7bf88f99bb9..2122517ce48 100644 --- a/tests/m2m_multiple/tests.py +++ b/tests/m2m_multiple/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import datetime diff --git a/tests/m2m_recursive/tests.py b/tests/m2m_recursive/tests.py index a3f2c670d63..3beafc9692b 100644 --- a/tests/m2m_recursive/tests.py +++ b/tests/m2m_recursive/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from operator import attrgetter diff --git a/tests/m2m_regress/tests.py b/tests/m2m_regress/tests.py index 884fc097a12..610f01694ae 100644 --- a/tests/m2m_regress/tests.py +++ b/tests/m2m_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase diff --git a/tests/m2m_signals/tests.py b/tests/m2m_signals/tests.py index d3d2a74c70e..569a2dc12d3 100644 --- a/tests/m2m_signals/tests.py +++ b/tests/m2m_signals/tests.py @@ -2,8 +2,6 @@ Testing signals emitted on changing m2m relations. """ -from .models import Person - from django.db import models from django.test import TestCase diff --git a/tests/m2m_through/tests.py b/tests/m2m_through/tests.py index 259dc68a0b2..69a7ec99bf7 100644 --- a/tests/m2m_through/tests.py +++ b/tests/m2m_through/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import datetime from operator import attrgetter diff --git a/tests/m2m_through_regress/tests.py b/tests/m2m_through_regress/tests.py index de4d52a2dbc..c1b229b30be 100644 --- a/tests/m2m_through_regress/tests.py +++ b/tests/m2m_through_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.core import management from django.contrib.auth.models import User diff --git a/tests/m2o_recursive/tests.py b/tests/m2o_recursive/tests.py index fa04c74ccae..f5e89387063 100644 --- a/tests/m2o_recursive/tests.py +++ b/tests/m2o_recursive/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/managers_regress/tests.py b/tests/managers_regress/tests.py index 45059be4e54..e5dce531229 100644 --- a/tests/managers_regress/tests.py +++ b/tests/managers_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import copy from django.conf import settings diff --git a/tests/many_to_many/tests.py b/tests/many_to_many/tests.py index 7d30379b94d..e6fed191fcb 100644 --- a/tests/many_to_many/tests.py +++ b/tests/many_to_many/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase from django.utils import six diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py index a4f87a32833..ae629288b1a 100644 --- a/tests/many_to_one/tests.py +++ b/tests/many_to_one/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from copy import deepcopy import datetime diff --git a/tests/many_to_one_null/tests.py b/tests/many_to_one_null/tests.py index 4de44b5e644..cd1800d77cd 100644 --- a/tests/many_to_one_null/tests.py +++ b/tests/many_to_one_null/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/many_to_one_regress/tests.py b/tests/many_to_one_regress/tests.py index 035ba53bffc..19cfaad0970 100644 --- a/tests/many_to_one_regress/tests.py +++ b/tests/many_to_one_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db import models from django.test import TestCase diff --git a/tests/max_lengths/tests.py b/tests/max_lengths/tests.py index 0f525864d5b..43f9e217c8d 100644 --- a/tests/max_lengths/tests.py +++ b/tests/max_lengths/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import unittest diff --git a/tests/middleware/tests.py b/tests/middleware/tests.py index 5ceab2e5947..0897ec06be5 100644 --- a/tests/middleware/tests.py +++ b/tests/middleware/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import gzip from io import BytesIO diff --git a/tests/middleware_exceptions/urls.py b/tests/middleware_exceptions/urls.py index 042607fdc8a..fcef6385534 100644 --- a/tests/middleware_exceptions/urls.py +++ b/tests/middleware_exceptions/urls.py @@ -1,6 +1,3 @@ -# coding: utf-8 -from __future__ import absolute_import - from django.conf.urls import patterns from . import views diff --git a/tests/model_fields/test_imagefield.py b/tests/model_fields/test_imagefield.py index f6019bd77f9..ce7d33eb32f 100644 --- a/tests/model_fields/test_imagefield.py +++ b/tests/model_fields/test_imagefield.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import os import shutil diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 1ce5eba3e99..a43f764407b 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime from decimal import Decimal diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py index 09c62c52057..21e3143be64 100644 --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime import os diff --git a/tests/model_forms_regress/tests.py b/tests/model_forms_regress/tests.py index 35e706ac4c5..ffe1123b994 100644 --- a/tests/model_forms_regress/tests.py +++ b/tests/model_forms_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from datetime import date import unittest diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py index 3bb4f95ea5b..053448181a5 100644 --- a/tests/model_formsets/tests.py +++ b/tests/model_formsets/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime import re diff --git a/tests/model_formsets_regress/tests.py b/tests/model_formsets_regress/tests.py index 179f79fbcb3..782c7d6fbc3 100644 --- a/tests/model_formsets_regress/tests.py +++ b/tests/model_formsets_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django import forms from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME diff --git a/tests/model_inheritance/tests.py b/tests/model_inheritance/tests.py index dc40d2d2e0c..eb50d30cf8d 100644 --- a/tests/model_inheritance/tests.py +++ b/tests/model_inheritance/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from operator import attrgetter diff --git a/tests/model_inheritance_regress/tests.py b/tests/model_inheritance_regress/tests.py index 7ca16647fac..10a1230685f 100644 --- a/tests/model_inheritance_regress/tests.py +++ b/tests/model_inheritance_regress/tests.py @@ -1,7 +1,7 @@ """ Regression tests for Model inheritance behavior. """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime from operator import attrgetter diff --git a/tests/model_inheritance_same_model_name/models.py b/tests/model_inheritance_same_model_name/models.py index b4a6b930df3..8b02b086688 100644 --- a/tests/model_inheritance_same_model_name/models.py +++ b/tests/model_inheritance_same_model_name/models.py @@ -6,8 +6,6 @@ in the need for an %(app_label)s format string. This app specifically tests this feature by redefining the Copy model from model_inheritance/models.py """ -from __future__ import absolute_import - from django.db import models from model_inheritance.models import NamedURL diff --git a/tests/model_inheritance_same_model_name/tests.py b/tests/model_inheritance_same_model_name/tests.py index 8f22578013a..fe1fb0cdd20 100644 --- a/tests/model_inheritance_same_model_name/tests.py +++ b/tests/model_inheritance_same_model_name/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/model_inheritance_select_related/tests.py b/tests/model_inheritance_select_related/tests.py index 078b466d0e8..68f9897e253 100644 --- a/tests/model_inheritance_select_related/tests.py +++ b/tests/model_inheritance_select_related/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from operator import attrgetter diff --git a/tests/model_package/models/__init__.py b/tests/model_package/models/__init__.py index 3c261aa4447..ec29d667f92 100644 --- a/tests/model_package/models/__init__.py +++ b/tests/model_package/models/__init__.py @@ -1,5 +1,3 @@ # Import all the models from subpackages -from __future__ import absolute_import - from .article import Article from .publication import Publication diff --git a/tests/model_package/tests.py b/tests/model_package/tests.py index 5d856a96085..a352b57478b 100644 --- a/tests/model_package/tests.py +++ b/tests/model_package/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.contrib.sites.models import Site from django.db import models diff --git a/tests/model_permalink/tests.py b/tests/model_permalink/tests.py index 257648ca5f6..ef682ed0e83 100644 --- a/tests/model_permalink/tests.py +++ b/tests/model_permalink/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.test import TestCase from .models import Guitarist diff --git a/tests/model_regress/tests.py b/tests/model_regress/tests.py index 2924b220e6d..f84a40b05b4 100644 --- a/tests/model_regress/tests.py +++ b/tests/model_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime from operator import attrgetter diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py index 0d0fed394a0..616b0889b95 100644 --- a/tests/modeladmin/tests.py +++ b/tests/modeladmin/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from datetime import date import unittest diff --git a/tests/multiple_database/models.py b/tests/multiple_database/models.py index e46438649b3..00534c870c1 100644 --- a/tests/multiple_database/models.py +++ b/tests/multiple_database/models.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic diff --git a/tests/multiple_database/tests.py b/tests/multiple_database/tests.py index 12a6379ca04..949679418c2 100644 --- a/tests/multiple_database/tests.py +++ b/tests/multiple_database/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime import pickle diff --git a/tests/mutually_referential/tests.py b/tests/mutually_referential/tests.py index b3deb0e75c3..60064658431 100644 --- a/tests/mutually_referential/tests.py +++ b/tests/mutually_referential/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.test import TestCase from .models import Parent diff --git a/tests/nested_foreign_keys/tests.py b/tests/nested_foreign_keys/tests.py index 5cb23cfb9c8..e8e20762fed 100644 --- a/tests/nested_foreign_keys/tests.py +++ b/tests/nested_foreign_keys/tests.py @@ -1,4 +1,5 @@ -from __future__ import absolute_import +from __future__ import unicode_literals + from django.test import TestCase from .models import Person, Movie, Event, Screening, ScreeningNullFK, Package, PackageNullFK diff --git a/tests/null_fk/tests.py b/tests/null_fk/tests.py index 96a06b67694..29e1fcb4bb6 100644 --- a/tests/null_fk/tests.py +++ b/tests/null_fk/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.db.models import Q from django.test import TestCase diff --git a/tests/null_fk_ordering/tests.py b/tests/null_fk_ordering/tests.py index aea969de4f7..70873244aca 100644 --- a/tests/null_fk_ordering/tests.py +++ b/tests/null_fk_ordering/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/null_queries/tests.py b/tests/null_queries/tests.py index 93e72d55d83..d08c9979d74 100644 --- a/tests/null_queries/tests.py +++ b/tests/null_queries/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase from django.core.exceptions import FieldError diff --git a/tests/one_to_one/tests.py b/tests/one_to_one/tests.py index a36764b7884..6e16d81cead 100644 --- a/tests/one_to_one/tests.py +++ b/tests/one_to_one/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db import transaction, IntegrityError from django.test import TestCase diff --git a/tests/one_to_one_regress/tests.py b/tests/one_to_one_regress/tests.py index 615536ba386..7d82194abb8 100644 --- a/tests/one_to_one_regress/tests.py +++ b/tests/one_to_one_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/or_lookups/tests.py b/tests/or_lookups/tests.py index e1c6fcb32ae..264d999575d 100644 --- a/tests/or_lookups/tests.py +++ b/tests/or_lookups/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import datetime from operator import attrgetter diff --git a/tests/order_with_respect_to/tests.py b/tests/order_with_respect_to/tests.py index 559cb1d996e..155c2386177 100644 --- a/tests/order_with_respect_to/tests.py +++ b/tests/order_with_respect_to/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from operator import attrgetter diff --git a/tests/ordering/tests.py b/tests/ordering/tests.py index b1b5253682e..63161a3273b 100644 --- a/tests/ordering/tests.py +++ b/tests/ordering/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import datetime from operator import attrgetter diff --git a/tests/pagination/tests.py b/tests/pagination/tests.py index 76799bec461..46ea428d174 100644 --- a/tests/pagination/tests.py +++ b/tests/pagination/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from datetime import datetime import unittest diff --git a/tests/prefetch_related/tests.py b/tests/prefetch_related/tests.py index 2e3fee6be65..9d5a5290da5 100644 --- a/tests/prefetch_related/tests.py +++ b/tests/prefetch_related/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.db import connection diff --git a/tests/properties/tests.py b/tests/properties/tests.py index 8a40d06e983..c471c414a17 100644 --- a/tests/properties/tests.py +++ b/tests/properties/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/proxy_model_inheritance/app1/models.py b/tests/proxy_model_inheritance/app1/models.py index affcf140ac7..a7a99fe46b7 100644 --- a/tests/proxy_model_inheritance/app1/models.py +++ b/tests/proxy_model_inheritance/app1/models.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - # TODO: why can't I make this ..app2 from app2.models import NiceModel diff --git a/tests/proxy_model_inheritance/tests.py b/tests/proxy_model_inheritance/tests.py index 85bf74a4e9c..dda09a080fe 100644 --- a/tests/proxy_model_inheritance/tests.py +++ b/tests/proxy_model_inheritance/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import os import sys diff --git a/tests/proxy_models/tests.py b/tests/proxy_models/tests.py index 5cc5ef54789..240198cc398 100644 --- a/tests/proxy_models/tests.py +++ b/tests/proxy_models/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import copy from django.conf import settings diff --git a/tests/queries/tests.py b/tests/queries/tests.py index 94c12c5ba98..025fcd86081 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import,unicode_literals +from __future__ import unicode_literals import datetime from operator import attrgetter diff --git a/tests/queryset_pickle/models.py b/tests/queryset_pickle/models.py index 3a8973505c7..dacd5018da5 100644 --- a/tests/queryset_pickle/models.py +++ b/tests/queryset_pickle/models.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - import datetime from django.db import models diff --git a/tests/queryset_pickle/tests.py b/tests/queryset_pickle/tests.py index d2f333a9b36..384073ad566 100644 --- a/tests/queryset_pickle/tests.py +++ b/tests/queryset_pickle/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import pickle import datetime @@ -83,7 +83,7 @@ class PickleabilityTestCase(TestCase): def test_model_pickle_dynamic(self): class Meta: proxy = True - dynclass = type("DynamicEventSubclass", (Event, ), + dynclass = type(str("DynamicEventSubclass"), (Event, ), {'Meta': Meta, '__module__': Event.__module__}) original = dynclass(pk=1) dumped = pickle.dumps(original) diff --git a/tests/raw_query/tests.py b/tests/raw_query/tests.py index 7242b8309b5..06c9b112302 100644 --- a/tests/raw_query/tests.py +++ b/tests/raw_query/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from datetime import date diff --git a/tests/reserved_names/tests.py b/tests/reserved_names/tests.py index ddffe08d345..cdf81b84770 100644 --- a/tests/reserved_names/tests.py +++ b/tests/reserved_names/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import datetime diff --git a/tests/reverse_lookup/tests.py b/tests/reverse_lookup/tests.py index 549ee66392d..ca16db0d314 100644 --- a/tests/reverse_lookup/tests.py +++ b/tests/reverse_lookup/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase diff --git a/tests/reverse_single_related/tests.py b/tests/reverse_single_related/tests.py index 0c755c4db61..472a3026b69 100644 --- a/tests/reverse_single_related/tests.py +++ b/tests/reverse_single_related/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.test import TestCase from .models import Source, Item diff --git a/tests/save_delete_hooks/tests.py b/tests/save_delete_hooks/tests.py index 42e0d4a80e0..0fd1ed4e038 100644 --- a/tests/save_delete_hooks/tests.py +++ b/tests/save_delete_hooks/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.test import TestCase from django.utils import six diff --git a/tests/select_for_update/tests.py b/tests/select_for_update/tests.py index 3204d74224d..3bd35448b17 100644 --- a/tests/select_for_update/tests.py +++ b/tests/select_for_update/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import sys import time diff --git a/tests/select_related/tests.py b/tests/select_related/tests.py index e6723eac9be..f07e28df99c 100644 --- a/tests/select_related/tests.py +++ b/tests/select_related/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/select_related_onetoone/tests.py b/tests/select_related_onetoone/tests.py index d8ba4d04844..3942b2d221f 100644 --- a/tests/select_related_onetoone/tests.py +++ b/tests/select_related_onetoone/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import unittest diff --git a/tests/select_related_regress/tests.py b/tests/select_related_regress/tests.py index f6d21b2dd9c..da47cb771f6 100644 --- a/tests/select_related_regress/tests.py +++ b/tests/select_related_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.test import TestCase from django.utils import six diff --git a/tests/serializers/tests.py b/tests/serializers/tests.py index bff7c53249f..07c220c52e8 100644 --- a/tests/serializers/tests.py +++ b/tests/serializers/tests.py @@ -1,6 +1,6 @@ -from __future__ import absolute_import, unicode_literals - # -*- coding: utf-8 -*- +from __future__ import unicode_literals + import json from datetime import datetime import unittest diff --git a/tests/serializers_regress/tests.py b/tests/serializers_regress/tests.py index 1751816ceec..3173f73985a 100644 --- a/tests/serializers_regress/tests.py +++ b/tests/serializers_regress/tests.py @@ -6,7 +6,7 @@ test case that is capable of testing the capabilities of the serializers. This includes all valid data values, plus forward, backwards and self references. """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime import decimal diff --git a/tests/servers/urls.py b/tests/servers/urls.py index a857c45f95f..03393c30ec3 100644 --- a/tests/servers/urls.py +++ b/tests/servers/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url from . import views diff --git a/tests/signals/tests.py b/tests/signals/tests.py index 58f25c28684..1dfe72bf5fb 100644 --- a/tests/signals/tests.py +++ b/tests/signals/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db.models import signals from django.dispatch import receiver diff --git a/tests/signals_regress/tests.py b/tests/signals_regress/tests.py index 8fb3ad5a48e..2c9858efda8 100644 --- a/tests/signals_regress/tests.py +++ b/tests/signals_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db import models from django.test import TestCase diff --git a/tests/sites_framework/tests.py b/tests/sites_framework/tests.py index 8e664fd5019..7860394aa2c 100644 --- a/tests/sites_framework/tests.py +++ b/tests/sites_framework/tests.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf import settings from django.contrib.sites.models import Site from django.test import TestCase diff --git a/tests/str/tests.py b/tests/str/tests.py index d82908a0ee6..3c0bc079c8f 100644 --- a/tests/str/tests.py +++ b/tests/str/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime from unittest import skipIf diff --git a/tests/string_lookup/tests.py b/tests/string_lookup/tests.py index b011720ddfb..5a17e55560b 100644 --- a/tests/string_lookup/tests.py +++ b/tests/string_lookup/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.test import TestCase from .models import Foo, Whiz, Bar, Article, Base, Child @@ -80,4 +80,4 @@ class StringLookupTests(TestCase): self.assertEqual(repr(Article.objects.filter(submitted_from__contains='192.0.2')), repr([a])) # Test that the searches do not match the subnet mask (/32 in this case) - self.assertEqual(Article.objects.filter(submitted_from__contains='32').count(), 0) \ No newline at end of file + self.assertEqual(Article.objects.filter(submitted_from__contains='32').count(), 0) diff --git a/tests/swappable_models/tests.py b/tests/swappable_models/tests.py index 858061db23b..2e2d544cea4 100644 --- a/tests/swappable_models/tests.py +++ b/tests/swappable_models/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.utils.six import StringIO diff --git a/tests/syndication/feeds.py b/tests/syndication/feeds.py index 1cd5c3d988e..f8ffb4b2e6c 100644 --- a/tests/syndication/feeds.py +++ b/tests/syndication/feeds.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.contrib.syndication import views from django.core.exceptions import ObjectDoesNotExist diff --git a/tests/syndication/tests.py b/tests/syndication/tests.py index d3b0058d539..8bc6b04939a 100644 --- a/tests/syndication/tests.py +++ b/tests/syndication/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from xml.dom import minidom diff --git a/tests/syndication/urls.py b/tests/syndication/urls.py index 06a75a4e68d..1b5d77f2e1e 100644 --- a/tests/syndication/urls.py +++ b/tests/syndication/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns from . import feeds diff --git a/tests/tablespaces/tests.py b/tests/tablespaces/tests.py index 1eaddef079d..088938ca1da 100644 --- a/tests/tablespaces/tests.py +++ b/tests/tablespaces/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import copy diff --git a/tests/template_tests/alternate_urls.py b/tests/template_tests/alternate_urls.py index fa4985a9dc2..3c6a4e62f9f 100644 --- a/tests/template_tests/alternate_urls.py +++ b/tests/template_tests/alternate_urls.py @@ -1,7 +1,3 @@ -# coding: utf-8 - -from __future__ import absolute_import - from django.conf.urls import patterns, url from . import views diff --git a/tests/template_tests/test_custom.py b/tests/template_tests/test_custom.py index e941bc223e9..c2dff03b10a 100644 --- a/tests/template_tests/test_custom.py +++ b/tests/template_tests/test_custom.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from unittest import TestCase diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py index 81f4682f160..aa0283be790 100644 --- a/tests/template_tests/tests.py +++ b/tests/template_tests/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.conf import settings diff --git a/tests/template_tests/urls.py b/tests/template_tests/urls.py index b5498fade1f..f3720bbda77 100644 --- a/tests/template_tests/urls.py +++ b/tests/template_tests/urls.py @@ -1,5 +1,5 @@ # coding: utf-8 -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.conf.urls import patterns, url from . import views diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py index 0f3cba7e88d..85637b982ed 100644 --- a/tests/test_client/tests.py +++ b/tests/test_client/tests.py @@ -20,7 +20,7 @@ testing against the contexts and templates produced by a view, rather than the HTML rendered to the end-user. """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.conf import settings from django.core import mail diff --git a/tests/test_client/urls.py b/tests/test_client/urls.py index bd395ca552b..4d2f4fb86ef 100644 --- a/tests/test_client/urls.py +++ b/tests/test_client/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns from django.views.generic import RedirectView diff --git a/tests/test_client_regress/urls.py b/tests/test_client_regress/urls.py index 1332537d572..6a0b330e02c 100644 --- a/tests/test_client_regress/urls.py +++ b/tests/test_client_regress/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url from django.views.generic import RedirectView diff --git a/tests/test_runner/tests.py b/tests/test_runner/tests.py index 48651b37ff1..7aefa4e0770 100644 --- a/tests/test_runner/tests.py +++ b/tests/test_runner/tests.py @@ -1,7 +1,7 @@ """ Tests for django test runner """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from importlib import import_module from optparse import make_option diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 24aa433dd3b..eb850cc3be1 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import unittest diff --git a/tests/test_utils/urls.py b/tests/test_utils/urls.py index 31fc5cc7fc6..65e8631735c 100644 --- a/tests/test_utils/urls.py +++ b/tests/test_utils/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns from . import views diff --git a/tests/test_utils/views.py b/tests/test_utils/views.py index 5495488e2c5..77e598b72cb 100644 --- a/tests/test_utils/views.py +++ b/tests/test_utils/views.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.http import HttpResponse from django.shortcuts import get_object_or_404 @@ -8,4 +6,4 @@ from .models import Person def get_person(request, pk): person = get_object_or_404(Person, pk=pk) - return HttpResponse(person.name) \ No newline at end of file + return HttpResponse(person.name) diff --git a/tests/timezones/admin.py b/tests/timezones/admin.py index 4c199813e25..81b49a4ab69 100644 --- a/tests/timezones/admin.py +++ b/tests/timezones/admin.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.contrib import admin from .models import Event, Timestamp diff --git a/tests/timezones/urls.py b/tests/timezones/urls.py index e4f42972dbc..e9a7a90df99 100644 --- a/tests/timezones/urls.py +++ b/tests/timezones/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, include from django.contrib import admin diff --git a/tests/transactions/tests.py b/tests/transactions/tests.py index afb573f3663..9cf8b4d7428 100644 --- a/tests/transactions/tests.py +++ b/tests/transactions/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import sys from unittest import skipIf, skipUnless diff --git a/tests/transactions_regress/tests.py b/tests/transactions_regress/tests.py index 01f8fc41864..2376bcd2774 100644 --- a/tests/transactions_regress/tests.py +++ b/tests/transactions_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from unittest import skipIf, skipUnless diff --git a/tests/unmanaged_models/tests.py b/tests/unmanaged_models/tests.py index d7cf961a37a..7b23a460963 100644 --- a/tests/unmanaged_models/tests.py +++ b/tests/unmanaged_models/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db import connection from django.test import TestCase diff --git a/tests/update/tests.py b/tests/update/tests.py index 7a1177c1fda..9db9625183f 100644 --- a/tests/update/tests.py +++ b/tests/update/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.test import TestCase diff --git a/tests/update_only_fields/tests.py b/tests/update_only_fields/tests.py index 97c05ddc793..1f85c3bbb28 100644 --- a/tests/update_only_fields/tests.py +++ b/tests/update_only_fields/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals from django.db.models.signals import pre_save, post_save from django.test import TestCase diff --git a/tests/urlpatterns_reverse/extra_urls.py b/tests/urlpatterns_reverse/extra_urls.py index d3a04e6b317..94e225fb469 100644 --- a/tests/urlpatterns_reverse/extra_urls.py +++ b/tests/urlpatterns_reverse/extra_urls.py @@ -2,8 +2,6 @@ Some extra URL patterns that are included at the top level. """ -from __future__ import absolute_import - from django.conf.urls import patterns, url, include from .views import empty_view diff --git a/tests/urlpatterns_reverse/included_named_urls.py b/tests/urlpatterns_reverse/included_named_urls.py index 353aed255e2..366fe9b57a9 100644 --- a/tests/urlpatterns_reverse/included_named_urls.py +++ b/tests/urlpatterns_reverse/included_named_urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url, include from .views import empty_view diff --git a/tests/urlpatterns_reverse/included_named_urls2.py b/tests/urlpatterns_reverse/included_named_urls2.py index b31bdb1f7ef..b8e4c531fa2 100644 --- a/tests/urlpatterns_reverse/included_named_urls2.py +++ b/tests/urlpatterns_reverse/included_named_urls2.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url from .views import empty_view diff --git a/tests/urlpatterns_reverse/included_namespace_urls.py b/tests/urlpatterns_reverse/included_namespace_urls.py index 7a2096ecd94..ae098a64dcf 100644 --- a/tests/urlpatterns_reverse/included_namespace_urls.py +++ b/tests/urlpatterns_reverse/included_namespace_urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url, include from .namespace_urls import URLObject diff --git a/tests/urlpatterns_reverse/included_urls.py b/tests/urlpatterns_reverse/included_urls.py index c8c9001843a..af6b6882e01 100644 --- a/tests/urlpatterns_reverse/included_urls.py +++ b/tests/urlpatterns_reverse/included_urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url from .views import empty_view diff --git a/tests/urlpatterns_reverse/included_urls2.py b/tests/urlpatterns_reverse/included_urls2.py index 98605047f48..9dcafc85356 100644 --- a/tests/urlpatterns_reverse/included_urls2.py +++ b/tests/urlpatterns_reverse/included_urls2.py @@ -5,8 +5,6 @@ each name to resolve and Django must distinguish the possibilities based on the argument list. """ -from __future__ import absolute_import - from django.conf.urls import patterns, url from .views import empty_view diff --git a/tests/urlpatterns_reverse/middleware.py b/tests/urlpatterns_reverse/middleware.py index fbf577786e2..0de692835f3 100644 --- a/tests/urlpatterns_reverse/middleware.py +++ b/tests/urlpatterns_reverse/middleware.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.core.urlresolvers import reverse from django.http import HttpResponse, StreamingHttpResponse diff --git a/tests/urlpatterns_reverse/named_urls.py b/tests/urlpatterns_reverse/named_urls.py index 3290cab29c9..d4d35bac339 100644 --- a/tests/urlpatterns_reverse/named_urls.py +++ b/tests/urlpatterns_reverse/named_urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url, include from .views import empty_view diff --git a/tests/urlpatterns_reverse/namespace_urls.py b/tests/urlpatterns_reverse/namespace_urls.py index cf960070eca..014bc659905 100644 --- a/tests/urlpatterns_reverse/namespace_urls.py +++ b/tests/urlpatterns_reverse/namespace_urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url, include from .views import view_class_instance diff --git a/tests/urlpatterns_reverse/reverse_lazy_urls.py b/tests/urlpatterns_reverse/reverse_lazy_urls.py index 693c6e1b38e..0ef0a1f3132 100644 --- a/tests/urlpatterns_reverse/reverse_lazy_urls.py +++ b/tests/urlpatterns_reverse/reverse_lazy_urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url from .views import empty_view, LazyRedirectView, login_required_view diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py index 222ebe053b1..aef0fa05147 100644 --- a/tests/urlpatterns_reverse/tests.py +++ b/tests/urlpatterns_reverse/tests.py @@ -1,7 +1,7 @@ """ Unit tests for reverse URL lookups. """ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import unittest diff --git a/tests/urlpatterns_reverse/urlconf_outer.py b/tests/urlpatterns_reverse/urlconf_outer.py index 0cdebf83ff5..20b9b09f98e 100644 --- a/tests/urlpatterns_reverse/urlconf_outer.py +++ b/tests/urlpatterns_reverse/urlconf_outer.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url, include from . import urlconf_inner @@ -8,4 +6,4 @@ from . import urlconf_inner urlpatterns = patterns('', url(r'^test/me/$', urlconf_inner.inner_view, name='outer'), url(r'^inner_urlconf/', include(urlconf_inner.__name__)) -) \ No newline at end of file +) diff --git a/tests/urlpatterns_reverse/urls.py b/tests/urlpatterns_reverse/urls.py index 1dbc8d889f0..cb08e2e664d 100644 --- a/tests/urlpatterns_reverse/urls.py +++ b/tests/urlpatterns_reverse/urls.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django.conf.urls import patterns, url, include from .views import empty_view, absolute_kwargs_view diff --git a/tests/urlpatterns_reverse/urls_error_handlers_callables.py b/tests/urlpatterns_reverse/urls_error_handlers_callables.py index befeccaf457..0900ec94ba4 100644 --- a/tests/urlpatterns_reverse/urls_error_handlers_callables.py +++ b/tests/urlpatterns_reverse/urls_error_handlers_callables.py @@ -1,7 +1,5 @@ # Used by the ErrorHandlerResolutionTests test case. -from __future__ import absolute_import - from django.conf.urls import patterns from .views import empty_view diff --git a/tests/urlpatterns_reverse/urls_without_full_import.py b/tests/urlpatterns_reverse/urls_without_full_import.py index ca3e424f23f..c1dce5549c3 100644 --- a/tests/urlpatterns_reverse/urls_without_full_import.py +++ b/tests/urlpatterns_reverse/urls_without_full_import.py @@ -1,8 +1,6 @@ # A URLs file that doesn't use the default # from django.conf.urls import * # import pattern. -from __future__ import absolute_import - from django.conf.urls import patterns, url from .views import empty_view, bad_view diff --git a/tests/utils_tests/test_safestring.py b/tests/utils_tests/test_safestring.py index a6f0c0a01c5..5d4528a9a8f 100644 --- a/tests/utils_tests/test_safestring.py +++ b/tests/utils_tests/test_safestring.py @@ -1,5 +1,4 @@ -from __future__ import absolute_import, unicode_literals - +from __future__ import unicode_literals from django.template import Template, Context from django.test import TestCase diff --git a/tests/validation/test_custom_messages.py b/tests/validation/test_custom_messages.py index c5a1ee744f6..2e259b7aef2 100644 --- a/tests/validation/test_custom_messages.py +++ b/tests/validation/test_custom_messages.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from . import ValidationTestCase from .models import CustomMessagesModel diff --git a/tests/validation/test_unique.py b/tests/validation/test_unique.py index a481fcb1c43..bca1b36c93c 100644 --- a/tests/validation/test_unique.py +++ b/tests/validation/test_unique.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import datetime import unittest diff --git a/tests/validation/test_validators.py b/tests/validation/test_validators.py index e58d9fd4a6e..c3875d46012 100644 --- a/tests/validation/test_validators.py +++ b/tests/validation/test_validators.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from . import ValidationTestCase from .models import ModelToValidate diff --git a/tests/validation/tests.py b/tests/validation/tests.py index c8b679541af..34cde3fc8a6 100644 --- a/tests/validation/tests.py +++ b/tests/validation/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django import forms from django.core.exceptions import NON_FIELD_ERRORS diff --git a/tests/view_tests/generic_urls.py b/tests/view_tests/generic_urls.py index c3ac1fcafad..10e7601eb6a 100644 --- a/tests/view_tests/generic_urls.py +++ b/tests/view_tests/generic_urls.py @@ -1,5 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.conf.urls import patterns, url from django.views.generic import RedirectView diff --git a/tests/view_tests/templatetags/debugtags.py b/tests/view_tests/templatetags/debugtags.py index cd2d2d9ad29..9e1945cb23b 100644 --- a/tests/view_tests/templatetags/debugtags.py +++ b/tests/view_tests/templatetags/debugtags.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from django import template from ..views import BrokenException diff --git a/tests/view_tests/tests/__init__.py b/tests/view_tests/tests/__init__.py index bfb2ed73765..dae149a8ef2 100644 --- a/tests/view_tests/tests/__init__.py +++ b/tests/view_tests/tests/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - from .test_debug import (DebugViewTests, ExceptionReporterTests, ExceptionReporterTests, PlainTextReportTests, ExceptionReporterFilterTests, AjaxResponseExceptionReporterFilter) diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index bc77fc351a4..01598869188 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # This coding header is significant for tests, as the debug view is parsing # files to search for such a header to decode the source file content -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals import inspect import os diff --git a/tests/view_tests/tests/test_defaults.py b/tests/view_tests/tests/test_defaults.py index 5efd338d345..af812b4446a 100644 --- a/tests/view_tests/tests/test_defaults.py +++ b/tests/view_tests/tests/test_defaults.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, unicode_literals +from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.test import TestCase diff --git a/tests/view_tests/tests/test_i18n.py b/tests/view_tests/tests/test_i18n.py index c1852ee71f4..7a7e615e92b 100644 --- a/tests/view_tests/tests/test_i18n.py +++ b/tests/view_tests/tests/test_i18n.py @@ -1,6 +1,4 @@ # -*- coding:utf-8 -*- -from __future__ import absolute_import - import gettext import os from os import path diff --git a/tests/view_tests/tests/test_static.py b/tests/view_tests/tests/test_static.py index 6104ad063e3..d2f3f47fa70 100644 --- a/tests/view_tests/tests/test_static.py +++ b/tests/view_tests/tests/test_static.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import mimetypes from os import path diff --git a/tests/view_tests/urls.py b/tests/view_tests/urls.py index d792e47ddfb..3dcee2fe532 100644 --- a/tests/view_tests/urls.py +++ b/tests/view_tests/urls.py @@ -1,6 +1,4 @@ # coding: utf-8 -from __future__ import absolute_import - from os import path from django.conf.urls import patterns, url, include diff --git a/tests/view_tests/views.py b/tests/view_tests/views.py index 1cfafa4333d..a40b1e0c579 100644 --- a/tests/view_tests/views.py +++ b/tests/view_tests/views.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import unicode_literals import sys