diff --git a/django/contrib/auth/tests/forms.py b/django/contrib/auth/tests/forms.py index 3c890d4c8a8..27908282ebe 100644 --- a/django/contrib/auth/tests/forms.py +++ b/django/contrib/auth/tests/forms.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import os from django.contrib.auth.models import User from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm, diff --git a/django/contrib/auth/tests/views.py b/django/contrib/auth/tests/views.py index 72440864da5..37045cd8987 100644 --- a/django/contrib/auth/tests/views.py +++ b/django/contrib/auth/tests/views.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import os import re import urllib diff --git a/django/contrib/contenttypes/tests.py b/django/contrib/contenttypes/tests.py index 3b7906c8129..0057dd535d3 100644 --- a/django/contrib/contenttypes/tests.py +++ b/django/contrib/contenttypes/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import urllib from django.db import models diff --git a/django/contrib/flatpages/tests/forms.py b/django/contrib/flatpages/tests/forms.py index 12b47e84d65..884c40acc80 100644 --- a/django/contrib/flatpages/tests/forms.py +++ b/django/contrib/flatpages/tests/forms.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage diff --git a/django/contrib/formtools/tests/wizard/wizardtests/tests.py b/django/contrib/formtools/tests/wizard/wizardtests/tests.py index 2ef39dc7a35..24234e442f9 100644 --- a/django/contrib/formtools/tests/wizard/wizardtests/tests.py +++ b/django/contrib/formtools/tests/wizard/wizardtests/tests.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import os from django import forms diff --git a/django/contrib/humanize/tests.py b/django/contrib/humanize/tests.py index f921b127780..2aa36443b10 100644 --- a/django/contrib/humanize/tests.py +++ b/django/contrib/humanize/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import datetime import new diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py index 7686bd254ee..107a7bcd803 100644 --- a/django/contrib/sessions/tests.py +++ b/django/contrib/sessions/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from datetime import datetime, timedelta import shutil import string diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py index 850b0132fbe..cab96c8d44c 100644 --- a/django/contrib/staticfiles/management/commands/collectstatic.py +++ b/django/contrib/staticfiles/management/commands/collectstatic.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os import sys from optparse import make_option diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py index c000f97d054..ea18497d532 100644 --- a/django/contrib/staticfiles/storage.py +++ b/django/contrib/staticfiles/storage.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import hashlib import os import posixpath diff --git a/django/core/cache/backends/locmem.py b/django/core/cache/backends/locmem.py index 6ba0c98945e..9196b3b42bc 100644 --- a/django/core/cache/backends/locmem.py +++ b/django/core/cache/backends/locmem.py @@ -1,7 +1,5 @@ "Thread-safe in-memory cache backend." -from __future__ import with_statement - import time try: import cPickle as pickle diff --git a/django/core/management/base.py b/django/core/management/base.py index a9fc38cfaa0..0bd64f24b52 100644 --- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -3,7 +3,6 @@ Base classes for writing management commands (named commands which can be executed through ``django-admin.py`` or ``manage.py``). """ -from __future__ import with_statement import os import sys diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index 0c234fb7463..3e5b7584f38 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -1,7 +1,3 @@ -# This is necessary in Python 2.5 to enable the with statement, in 2.6 -# and up it is no longer necessary. -from __future__ import with_statement - import sys import os import gzip diff --git a/django/core/management/templates.py b/django/core/management/templates.py index 9a4b2c1723f..b2a1226dbc9 100644 --- a/django/core/management/templates.py +++ b/django/core/management/templates.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import cgi import errno import mimetypes diff --git a/django/db/transaction.py b/django/db/transaction.py index 4ecd2d1f084..f3ce2b23352 100644 --- a/django/db/transaction.py +++ b/django/db/transaction.py @@ -11,7 +11,6 @@ called, a commit is made. Managed transactions don't do those commits, but will need some kind of manual or implicit commits or rollbacks. """ -from __future__ import with_statement from functools import wraps diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py index dc3d93e90f2..ca79f41edc0 100644 --- a/django/templatetags/i18n.py +++ b/django/templatetags/i18n.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import re from django.template import (Node, Variable, TemplateSyntaxError, diff --git a/django/templatetags/tz.py b/django/templatetags/tz.py index 48c511f2e0c..ea35b75e779 100644 --- a/django/templatetags/tz.py +++ b/django/templatetags/tz.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from datetime import datetime, tzinfo try: diff --git a/django/test/testcases.py b/django/test/testcases.py index b5e1dc04183..c57099fc926 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import difflib import os import re diff --git a/django/test/utils.py b/django/test/utils.py index ed5ab590a78..805117df808 100644 --- a/django/test/utils.py +++ b/django/test/utils.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import warnings from django.conf import settings, UserSettingsHolder from django.core import mail diff --git a/django/utils/archive.py b/django/utils/archive.py index 9c2d4ac01b0..027acf788a0 100644 --- a/django/utils/archive.py +++ b/django/utils/archive.py @@ -21,7 +21,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -from __future__ import with_statement import os import shutil import sys diff --git a/django/utils/synch.py b/django/utils/synch.py index d6ae2f0a72d..4859907ae24 100644 --- a/django/utils/synch.py +++ b/django/utils/synch.py @@ -6,8 +6,6 @@ Synchronization primitives: (Contributed to Django by eugene@lazutkin.com) """ -from __future__ import with_statement - import contextlib try: import threading @@ -92,4 +90,4 @@ class RWLock(object): try: yield finally: - self.writer_leaves() \ No newline at end of file + self.writer_leaves() diff --git a/django/views/static.py b/django/views/static.py index ed237793e4c..2a756134a6c 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -2,7 +2,6 @@ Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ -from __future__ import with_statement import mimetypes import os diff --git a/tests/modeltests/distinct_on_fields/tests.py b/tests/modeltests/distinct_on_fields/tests.py index 5021bc80880..4d827d15b63 100644 --- a/tests/modeltests/distinct_on_fields/tests.py +++ b/tests/modeltests/distinct_on_fields/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from django.db.models import Max from django.test import TestCase, skipUnlessDBFeature diff --git a/tests/modeltests/empty/tests.py b/tests/modeltests/empty/tests.py index 255b80eb8f6..db464c632d5 100644 --- a/tests/modeltests/empty/tests.py +++ b/tests/modeltests/empty/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.conf import settings from django.core.exceptions import ImproperlyConfigured diff --git a/tests/modeltests/files/tests.py b/tests/modeltests/files/tests.py index 50017be359a..3bfe193610b 100644 --- a/tests/modeltests/files/tests.py +++ b/tests/modeltests/files/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import shutil import tempfile diff --git a/tests/modeltests/lookup/tests.py b/tests/modeltests/lookup/tests.py index 3571e216be1..60ab25fc633 100644 --- a/tests/modeltests/lookup/tests.py +++ b/tests/modeltests/lookup/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from datetime import datetime from operator import attrgetter diff --git a/tests/modeltests/many_to_many/tests.py b/tests/modeltests/many_to_many/tests.py index 9fa524f9935..44bdde3aeb0 100644 --- a/tests/modeltests/many_to_many/tests.py +++ b/tests/modeltests/many_to_many/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/modeltests/many_to_one/tests.py b/tests/modeltests/many_to_one/tests.py index d9d67bbb98a..aed952fe2fc 100644 --- a/tests/modeltests/many_to_one/tests.py +++ b/tests/modeltests/many_to_one/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from copy import deepcopy from datetime import datetime diff --git a/tests/modeltests/many_to_one_null/tests.py b/tests/modeltests/many_to_one_null/tests.py index 1e302ecada9..1a404bde02d 100644 --- a/tests/modeltests/many_to_one_null/tests.py +++ b/tests/modeltests/many_to_one_null/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/modeltests/model_forms/tests.py b/tests/modeltests/model_forms/tests.py index ff5048eced3..fe20d79a29b 100644 --- a/tests/modeltests/model_forms/tests.py +++ b/tests/modeltests/model_forms/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime import os diff --git a/tests/modeltests/prefetch_related/tests.py b/tests/modeltests/prefetch_related/tests.py index b0bc4359415..135b5b8ad28 100644 --- a/tests/modeltests/prefetch_related/tests.py +++ b/tests/modeltests/prefetch_related/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.contrib.contenttypes.models import ContentType from django.test import TestCase diff --git a/tests/modeltests/properties/tests.py b/tests/modeltests/properties/tests.py index f01b22a4bb7..8a40d06e983 100644 --- a/tests/modeltests/properties/tests.py +++ b/tests/modeltests/properties/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/modeltests/select_related/tests.py b/tests/modeltests/select_related/tests.py index 1b3715a1c82..ebe2f8c2be7 100644 --- a/tests/modeltests/select_related/tests.py +++ b/tests/modeltests/select_related/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/modeltests/serializers/tests.py b/tests/modeltests/serializers/tests.py index 309a83e8b47..02538b0fb71 100644 --- a/tests/modeltests/serializers/tests.py +++ b/tests/modeltests/serializers/tests.py @@ -1,6 +1,4 @@ -# This is necessary in Python 2.5 to enable the with statement, in 2.6 -# and up it is no longer necessary. -from __future__ import with_statement, absolute_import +from __future__ import absolute_import # -*- coding: utf-8 -*- from datetime import datetime diff --git a/tests/modeltests/timezones/tests.py b/tests/modeltests/timezones/tests.py index 171c2187f22..b1e22e1a557 100644 --- a/tests/modeltests/timezones/tests.py +++ b/tests/modeltests/timezones/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import datetime import os import sys diff --git a/tests/modeltests/transactions/tests.py b/tests/modeltests/transactions/tests.py index ed416e24b7e..f3246eef2af 100644 --- a/tests/modeltests/transactions/tests.py +++ b/tests/modeltests/transactions/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.db import connection, transaction, IntegrityError from django.test import TransactionTestCase, skipUnlessDBFeature diff --git a/tests/modeltests/user_commands/tests.py b/tests/modeltests/user_commands/tests.py index e138e07b913..896dd667ff7 100644 --- a/tests/modeltests/user_commands/tests.py +++ b/tests/modeltests/user_commands/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from StringIO import StringIO from django.core import management diff --git a/tests/modeltests/validation/__init__.py b/tests/modeltests/validation/__init__.py index 4a1ad3ab563..5daa06be66f 100644 --- a/tests/modeltests/validation/__init__.py +++ b/tests/modeltests/validation/__init__.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from django.core.exceptions import ValidationError from django.test import TestCase diff --git a/tests/modeltests/validation/test_unique.py b/tests/modeltests/validation/test_unique.py index 3ae981d45c6..497bb9d72d7 100644 --- a/tests/modeltests/validation/test_unique.py +++ b/tests/modeltests/validation/test_unique.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime diff --git a/tests/regressiontests/admin_changelist/tests.py b/tests/regressiontests/admin_changelist/tests.py index d2b017b258b..7e4546e5b36 100644 --- a/tests/regressiontests/admin_changelist/tests.py +++ b/tests/regressiontests/admin_changelist/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.contrib import admin from django.contrib.admin.options import IncorrectLookupParameters diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py index 669c6e82584..dd3b0b4385a 100644 --- a/tests/regressiontests/admin_scripts/tests.py +++ b/tests/regressiontests/admin_scripts/tests.py @@ -3,7 +3,6 @@ A series of tests to establish that the command-line managment tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ -from __future__ import with_statement import os import re diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 12f1c677af7..b4718447d1d 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -1,5 +1,5 @@ # coding: utf-8 -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import os import re diff --git a/tests/regressiontests/admin_widgets/tests.py b/tests/regressiontests/admin_widgets/tests.py index 87e0309ddcb..ab6db4d1fba 100644 --- a/tests/regressiontests/admin_widgets/tests.py +++ b/tests/regressiontests/admin_widgets/tests.py @@ -1,5 +1,5 @@ # encoding: utf-8 -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from datetime import datetime diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index cfb662ee804..d5b1ea82bf9 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Unit and doctests for specific database backends. -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime import threading diff --git a/tests/regressiontests/bug8245/tests.py b/tests/regressiontests/bug8245/tests.py index b756b841449..5da0b1f7185 100644 --- a/tests/regressiontests/bug8245/tests.py +++ b/tests/regressiontests/bug8245/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from django.contrib import admin from django.utils.unittest import TestCase @@ -19,4 +17,4 @@ class Bug8245Test(TestCase): # the first time, not an AlreadyRegistered error. with self.assertRaises(Exception) as cm: admin.autodiscover() - self.assertEqual(str(cm.exception), "Bad admin module") \ No newline at end of file + self.assertEqual(str(cm.exception), "Bad admin module") diff --git a/tests/regressiontests/bulk_create/tests.py b/tests/regressiontests/bulk_create/tests.py index 0fa142b7959..284ea9fdd9f 100644 --- a/tests/regressiontests/bulk_create/tests.py +++ b/tests/regressiontests/bulk_create/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from operator import attrgetter diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py index bd29cde5330..6dbc03db322 100644 --- a/tests/regressiontests/cache/tests.py +++ b/tests/regressiontests/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 with_statement, absolute_import +from __future__ import absolute_import import hashlib import os diff --git a/tests/regressiontests/comment_tests/tests/model_tests.py b/tests/regressiontests/comment_tests/tests/model_tests.py index 11d96aea70e..69c1a8118f3 100644 --- a/tests/regressiontests/comment_tests/tests/model_tests.py +++ b/tests/regressiontests/comment_tests/tests/model_tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from django.contrib.comments.models import Comment diff --git a/tests/regressiontests/comment_tests/tests/templatetag_tests.py b/tests/regressiontests/comment_tests/tests/templatetag_tests.py index 0b036ce9213..62b3fb35db2 100644 --- a/tests/regressiontests/comment_tests/tests/templatetag_tests.py +++ b/tests/regressiontests/comment_tests/tests/templatetag_tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment diff --git a/tests/regressiontests/csrf_tests/tests.py b/tests/regressiontests/csrf_tests/tests.py index 71400ead893..d403951ae24 100644 --- a/tests/regressiontests/csrf_tests/tests.py +++ b/tests/regressiontests/csrf_tests/tests.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement from django.conf import settings from django.core.context_processors import csrf diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py index 1660a75e9c9..38e44d48691 100644 --- a/tests/regressiontests/defaultfilters/tests.py +++ b/tests/regressiontests/defaultfilters/tests.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement import datetime import decimal diff --git a/tests/regressiontests/defer_regress/tests.py b/tests/regressiontests/defer_regress/tests.py index 4afe39bee21..c9baad6a1f4 100644 --- a/tests/regressiontests/defer_regress/tests.py +++ b/tests/regressiontests/defer_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from operator import attrgetter diff --git a/tests/regressiontests/forms/tests/models.py b/tests/regressiontests/forms/tests/models.py index b5e2c3a885b..64cd18bde62 100644 --- a/tests/regressiontests/forms/tests/models.py +++ b/tests/regressiontests/forms/tests/models.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime diff --git a/tests/regressiontests/forms/tests/regressions.py b/tests/regressiontests/forms/tests/regressions.py index a93781da20b..267ef300e69 100644 --- a/tests/regressiontests/forms/tests/regressions.py +++ b/tests/regressiontests/forms/tests/regressions.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement from django.forms import * from django.test import TestCase from django.utils.translation import ugettext_lazy, override diff --git a/tests/regressiontests/i18n/commands/compilation.py b/tests/regressiontests/i18n/commands/compilation.py index ee558b261bf..1f38910b61d 100644 --- a/tests/regressiontests/i18n/commands/compilation.py +++ b/tests/regressiontests/i18n/commands/compilation.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os try: from cStringIO import StringIO diff --git a/tests/regressiontests/i18n/commands/extraction.py b/tests/regressiontests/i18n/commands/extraction.py index 4eb7abc7f0f..fb9ca4ed087 100644 --- a/tests/regressiontests/i18n/commands/extraction.py +++ b/tests/regressiontests/i18n/commands/extraction.py @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -from __future__ import with_statement import os import re diff --git a/tests/regressiontests/i18n/contenttypes/tests.py b/tests/regressiontests/i18n/contenttypes/tests.py index 79928d9e4f7..a44895f0cc1 100644 --- a/tests/regressiontests/i18n/contenttypes/tests.py +++ b/tests/regressiontests/i18n/contenttypes/tests.py @@ -1,5 +1,4 @@ # coding: utf-8 -from __future__ import with_statement import os diff --git a/tests/regressiontests/i18n/patterns/tests.py b/tests/regressiontests/i18n/patterns/tests.py index 16fbec014a9..df7beac2393 100644 --- a/tests/regressiontests/i18n/patterns/tests.py +++ b/tests/regressiontests/i18n/patterns/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os import warnings diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 99a55bd24d3..f0b4a61abbf 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime import decimal diff --git a/tests/regressiontests/logging_tests/tests.py b/tests/regressiontests/logging_tests/tests.py index 4e29e25d993..5563ea6b4fa 100644 --- a/tests/regressiontests/logging_tests/tests.py +++ b/tests/regressiontests/logging_tests/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import copy from django.conf import compat_patch_logging_config @@ -9,7 +7,6 @@ from django.test.utils import override_settings from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger - # logging config prior to using filter with mail_admins OLD_LOGGING = { 'version': 1, diff --git a/tests/regressiontests/model_formsets_regress/tests.py b/tests/regressiontests/model_formsets_regress/tests.py index d058f1d8bcb..f1e935e2ea8 100644 --- a/tests/regressiontests/model_formsets_regress/tests.py +++ b/tests/regressiontests/model_formsets_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from django import forms from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME diff --git a/tests/regressiontests/modeladmin/tests.py b/tests/regressiontests/modeladmin/tests.py index f9dec69ae8b..04b02eb36b8 100644 --- a/tests/regressiontests/modeladmin/tests.py +++ b/tests/regressiontests/modeladmin/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from datetime import date diff --git a/tests/regressiontests/requests/tests.py b/tests/regressiontests/requests/tests.py index b7a4788ec5b..f986046b5de 100644 --- a/tests/regressiontests/requests/tests.py +++ b/tests/regressiontests/requests/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import time import warnings from datetime import datetime, timedelta diff --git a/tests/regressiontests/select_related_onetoone/tests.py b/tests/regressiontests/select_related_onetoone/tests.py index 643a0ffc406..d57ee905704 100644 --- a/tests/regressiontests/select_related_onetoone/tests.py +++ b/tests/regressiontests/select_related_onetoone/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/regressiontests/serializers_regress/tests.py b/tests/regressiontests/serializers_regress/tests.py index 65194da4281..289db05c716 100644 --- a/tests/regressiontests/serializers_regress/tests.py +++ b/tests/regressiontests/serializers_regress/tests.py @@ -6,9 +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. """ -# This is necessary in Python 2.5 to enable the with statement, in 2.6 -# and up it is no longer necessary. -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime import decimal diff --git a/tests/regressiontests/settings_tests/tests.py b/tests/regressiontests/settings_tests/tests.py index a2e6c490b4e..47e5b089529 100644 --- a/tests/regressiontests/settings_tests/tests.py +++ b/tests/regressiontests/settings_tests/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os from django.conf import settings, global_settings diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py index 733c3cc8459..7639161fc0f 100644 --- a/tests/regressiontests/staticfiles_tests/tests.py +++ b/tests/regressiontests/staticfiles_tests/tests.py @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -from __future__ import with_statement import codecs import os diff --git a/tests/regressiontests/templates/response.py b/tests/regressiontests/templates/response.py index 5feb8cc51b0..7c59da2b32a 100644 --- a/tests/regressiontests/templates/response.py +++ b/tests/regressiontests/templates/response.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os import pickle import time diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index f74aa757e6a..e166f7e15b4 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.conf import settings diff --git a/tests/regressiontests/test_utils/tests.py b/tests/regressiontests/test_utils/tests.py index 7f4208c0e1a..3afce90a565 100644 --- a/tests/regressiontests/test_utils/tests.py +++ b/tests/regressiontests/test_utils/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.forms import EmailField, IntegerField from django.http import HttpResponse diff --git a/tests/regressiontests/text/tests.py b/tests/regressiontests/text/tests.py index 2bbd8efe37d..e4c4c009382 100644 --- a/tests/regressiontests/text/tests.py +++ b/tests/regressiontests/text/tests.py @@ -1,5 +1,4 @@ # coding: utf-8 -from __future__ import with_statement from django.test import TestCase from django.utils.encoding import iri_to_uri diff --git a/tests/regressiontests/views/tests/debug.py b/tests/regressiontests/views/tests/debug.py index c6f248a8b80..2be33c47e84 100644 --- a/tests/regressiontests/views/tests/debug.py +++ b/tests/regressiontests/views/tests/debug.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import inspect import os diff --git a/tests/regressiontests/views/tests/i18n.py b/tests/regressiontests/views/tests/i18n.py index 877cf964ddb..9993ae959c8 100644 --- a/tests/regressiontests/views/tests/i18n.py +++ b/tests/regressiontests/views/tests/i18n.py @@ -1,5 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import gettext from os import path diff --git a/tests/regressiontests/wsgi/tests.py b/tests/regressiontests/wsgi/tests.py index 9da2adce542..0e8d7f2adab 100644 --- a/tests/regressiontests/wsgi/tests.py +++ b/tests/regressiontests/wsgi/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from django.core.exceptions import ImproperlyConfigured from django.core.servers.basehttp import get_internal_wsgi_application from django.core.wsgi import get_wsgi_application