From 8c0eefd066aa0e5bfe8c1006d055be8e2ad69a2b Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 13 Oct 2011 21:34:56 +0000 Subject: [PATCH] Convert the remainder of the relative imports in the tests to be absolute imports. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16981 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../generic_inline_admin/admin.py | 5 +- .../generic_inline_admin/models.py | 2 +- .../generic_inline_admin/tests.py | 6 +- .../generic_inline_admin/urls.py | 4 +- .../generic_relations_regress/models.py | 7 +- .../generic_relations_regress/tests.py | 7 +- tests/regressiontests/generic_views/base.py | 2 +- tests/regressiontests/generic_views/dates.py | 5 +- tests/regressiontests/generic_views/detail.py | 4 +- tests/regressiontests/generic_views/edit.py | 7 +- tests/regressiontests/generic_views/forms.py | 4 +- tests/regressiontests/generic_views/list.py | 5 +- tests/regressiontests/generic_views/models.py | 1 + tests/regressiontests/generic_views/tests.py | 15 ++-- tests/regressiontests/generic_views/urls.py | 10 ++- tests/regressiontests/generic_views/views.py | 6 +- .../get_or_create_regress/tests.py | 4 +- tests/regressiontests/handlers/tests.py | 2 +- tests/regressiontests/httpwrappers/tests.py | 1 + .../i18n/commands/compilation.py | 2 +- .../i18n/commands/extraction.py | 4 +- .../i18n/contenttypes/tests.py | 2 +- tests/regressiontests/i18n/forms.py | 5 +- tests/regressiontests/i18n/models.py | 2 + tests/regressiontests/i18n/test_warnings.py | 2 +- tests/regressiontests/i18n/tests.py | 21 ++--- .../initial_sql_regress/models.py | 1 + .../initial_sql_regress/tests.py | 2 +- .../regressiontests/inline_formsets/tests.py | 4 +- tests/regressiontests/introspection/models.py | 1 + tests/regressiontests/introspection/tests.py | 5 +- tests/regressiontests/localflavor/au/forms.py | 6 +- .../regressiontests/localflavor/au/models.py | 2 +- tests/regressiontests/localflavor/au/tests.py | 5 +- tests/regressiontests/localflavor/mk/forms.py | 6 +- .../regressiontests/localflavor/mk/models.py | 3 +- tests/regressiontests/localflavor/mk/tests.py | 7 +- tests/regressiontests/localflavor/mx/forms.py | 6 +- .../regressiontests/localflavor/mx/models.py | 3 +- tests/regressiontests/localflavor/mx/tests.py | 5 +- tests/regressiontests/localflavor/tests.py | 86 ++++++++++--------- tests/regressiontests/localflavor/us/forms.py | 6 +- .../regressiontests/localflavor/us/models.py | 3 +- tests/regressiontests/localflavor/us/tests.py | 7 +- tests/regressiontests/logging_tests/tests.py | 8 +- tests/regressiontests/m2m_regress/models.py | 2 +- tests/regressiontests/m2m_regress/tests.py | 4 +- .../m2m_through_regress/models.py | 3 +- .../m2m_through_regress/tests.py | 6 +- .../managers_regress/models.py | 1 + .../regressiontests/managers_regress/tests.py | 4 +- .../many_to_one_regress/tests.py | 5 +- tests/regressiontests/max_lengths/models.py | 1 + tests/regressiontests/max_lengths/tests.py | 5 +- .../middleware_exceptions/urls.py | 4 +- .../model_fields/imagefield.py | 8 +- tests/regressiontests/model_fields/tests.py | 13 +-- .../model_forms_regress/models.py | 3 +- .../model_forms_regress/tests.py | 4 +- .../model_formsets_regress/models.py | 1 + .../model_formsets_regress/tests.py | 4 +- .../model_inheritance_regress/tests.py | 4 +- .../models.py | 1 + .../model_inheritance_select_related/tests.py | 4 +- .../regressiontests/model_permalink/models.py | 1 + .../regressiontests/model_permalink/tests.py | 6 +- tests/regressiontests/model_regress/tests.py | 4 +- tests/regressiontests/modeladmin/models.py | 3 +- tests/regressiontests/modeladmin/tests.py | 5 +- .../multiple_database/models.py | 3 + .../multiple_database/tests.py | 4 +- tests/regressiontests/null_fk/models.py | 1 + tests/regressiontests/null_fk/tests.py | 10 ++- .../null_fk_ordering/models.py | 1 + .../regressiontests/null_fk_ordering/tests.py | 5 +- tests/regressiontests/null_queries/models.py | 1 + tests/regressiontests/null_queries/tests.py | 4 +- .../one_to_one_regress/models.py | 1 + .../one_to_one_regress/tests.py | 6 +- tests/regressiontests/queries/models.py | 3 +- tests/regressiontests/queries/tests.py | 13 +-- .../regressiontests/queryset_pickle/models.py | 4 + .../regressiontests/queryset_pickle/tests.py | 4 +- .../reverse_single_related/models.py | 1 + .../reverse_single_related/tests.py | 5 +- .../select_related_onetoone/tests.py | 4 +- .../select_related_regress/models.py | 1 + .../select_related_regress/tests.py | 8 +- .../serializers_regress/tests.py | 18 +++- tests/regressiontests/settings_tests/tests.py | 2 + .../regressiontests/signals_regress/models.py | 1 + .../regressiontests/signals_regress/tests.py | 7 +- .../signed_cookies_tests/tests.py | 1 + tests/regressiontests/signing/tests.py | 1 + .../regressiontests/sites_framework/tests.py | 16 ++-- .../regressiontests/special_headers/models.py | 1 + .../regressiontests/special_headers/tests.py | 2 +- tests/regressiontests/special_headers/urls.py | 7 +- .../staticfiles_tests/tests.py | 1 + tests/regressiontests/string_lookup/models.py | 1 + tests/regressiontests/string_lookup/tests.py | 5 +- tests/regressiontests/syndication/feeds.py | 5 +- tests/regressiontests/syndication/models.py | 1 + tests/regressiontests/syndication/tests.py | 4 +- tests/regressiontests/syndication/urls.py | 5 +- .../templates/alternate_urls.py | 5 +- tests/regressiontests/templates/custom.py | 6 +- tests/regressiontests/templates/response.py | 4 +- .../templates/templatetags/bad_tag.py | 1 + tests/regressiontests/templates/tests.py | 26 +++--- tests/regressiontests/templates/urls.py | 5 +- .../test_client_regress/urls.py | 6 +- tests/regressiontests/test_runner/tests.py | 4 +- tests/regressiontests/test_utils/tests.py | 4 +- tests/regressiontests/test_utils/urls.py | 4 +- tests/regressiontests/test_utils/views.py | 6 +- .../transactions_regress/tests.py | 4 +- .../urlpatterns_reverse/extra_urls.py | 6 +- .../included_named_urls.py | 6 +- .../included_named_urls2.py | 6 +- .../included_namespace_urls.py | 8 +- .../urlpatterns_reverse/included_urls.py | 6 +- .../urlpatterns_reverse/included_urls2.py | 6 +- .../urlpatterns_reverse/middleware.py | 5 +- .../urlpatterns_reverse/named_urls.py | 6 +- .../urlpatterns_reverse/namespace_urls.py | 6 +- .../urlpatterns_reverse/reverse_lazy_urls.py | 4 +- .../urlpatterns_reverse/tests.py | 14 +-- .../urlpatterns_reverse/urlconf_outer.py | 4 +- .../urlpatterns_reverse/urls.py | 6 +- .../urls_error_handlers_callables.py | 6 +- .../urls_without_full_import.py | 6 +- .../regressiontests/utils/simplelazyobject.py | 2 +- tests/regressiontests/utils/tests.py | 39 +++++---- tests/regressiontests/views/generic_urls.py | 7 +- .../views/templatetags/debugtags.py | 7 +- tests/regressiontests/views/tests/__init__.py | 25 +++--- tests/regressiontests/views/tests/debug.py | 9 +- tests/regressiontests/views/tests/defaults.py | 5 +- tests/regressiontests/views/tests/i18n.py | 6 +- tests/regressiontests/views/tests/static.py | 7 +- tests/regressiontests/views/urls.py | 4 +- tests/regressiontests/views/views.py | 7 +- tests/runtests.py | 3 +- 144 files changed, 580 insertions(+), 265 deletions(-) diff --git a/tests/regressiontests/generic_inline_admin/admin.py b/tests/regressiontests/generic_inline_admin/admin.py index 87224edab7..73cac7f7c5 100644 --- a/tests/regressiontests/generic_inline_admin/admin.py +++ b/tests/regressiontests/generic_inline_admin/admin.py @@ -1,9 +1,12 @@ +from __future__ import absolute_import + from django.contrib import admin from django.contrib.contenttypes import generic -from models import (Media, PhoneNumber, Episode, EpisodeExtra, Contact, +from .models import (Media, PhoneNumber, Episode, EpisodeExtra, Contact, Category, EpisodePermanent, EpisodeMaxNum) + site = admin.AdminSite(name="admin") class MediaInline(generic.GenericTabularInline): diff --git a/tests/regressiontests/generic_inline_admin/models.py b/tests/regressiontests/generic_inline_admin/models.py index e78f110416..b9426b4f2a 100644 --- a/tests/regressiontests/generic_inline_admin/models.py +++ b/tests/regressiontests/generic_inline_admin/models.py @@ -1,6 +1,6 @@ -from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType +from django.db import models class Episode(models.Model): diff --git a/tests/regressiontests/generic_inline_admin/tests.py b/tests/regressiontests/generic_inline_admin/tests.py index baea85717b..2c82acfd01 100644 --- a/tests/regressiontests/generic_inline_admin/tests.py +++ b/tests/regressiontests/generic_inline_admin/tests.py @@ -1,5 +1,7 @@ # coding: utf-8 +from __future__ import absolute_import + from django.conf import settings from django.contrib import admin from django.contrib.admin.sites import AdminSite @@ -9,9 +11,9 @@ from django.forms.models import ModelForm from django.test import TestCase # local test models -from models import (Episode, EpisodeExtra, EpisodeMaxNum, Media, +from .admin import MediaInline, MediaPermanentInline +from .models import (Episode, EpisodeExtra, EpisodeMaxNum, Media, EpisodePermanent, Category) -from admin import MediaInline, MediaPermanentInline class GenericAdminViewTest(TestCase): diff --git a/tests/regressiontests/generic_inline_admin/urls.py b/tests/regressiontests/generic_inline_admin/urls.py index 03431d3226..88d7b574d4 100644 --- a/tests/regressiontests/generic_inline_admin/urls.py +++ b/tests/regressiontests/generic_inline_admin/urls.py @@ -1,6 +1,8 @@ +from __future__ import absolute_import + from django.conf.urls import patterns, include -import admin +from . import admin urlpatterns = patterns('', (r'^generic_inline_admin/admin/', include(admin.site.urls)), diff --git a/tests/regressiontests/generic_relations_regress/models.py b/tests/regressiontests/generic_relations_regress/models.py index d28385d398..7ec752b02b 100644 --- a/tests/regressiontests/generic_relations_regress/models.py +++ b/tests/regressiontests/generic_relations_regress/models.py @@ -1,9 +1,10 @@ -from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType +from django.db import models -__all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address', - 'CharLink', 'TextLink', 'OddRelation1', 'OddRelation2', + +__all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address', + 'CharLink', 'TextLink', 'OddRelation1', 'OddRelation2', 'Contact', 'Organization', 'Note') class Link(models.Model): diff --git a/tests/regressiontests/generic_relations_regress/tests.py b/tests/regressiontests/generic_relations_regress/tests.py index 52731a9a43..4c0f024433 100644 --- a/tests/regressiontests/generic_relations_regress/tests.py +++ b/tests/regressiontests/generic_relations_regress/tests.py @@ -1,6 +1,9 @@ -from django.test import TestCase from django.db.models import Q -from models import * +from django.test import TestCase + +from .models import (Address, Place, Restaurant, Link, CharLink, TextLink, + Person, Contact, Note, Organization, OddRelation1, OddRelation2) + class GenericRelationTests(TestCase): diff --git a/tests/regressiontests/generic_views/base.py b/tests/regressiontests/generic_views/base.py index 00fa0d9b79..d9debb6627 100644 --- a/tests/regressiontests/generic_views/base.py +++ b/tests/regressiontests/generic_views/base.py @@ -1,9 +1,9 @@ import time -import unittest from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.test import TestCase, RequestFactory +from django.utils import unittest from django.views.generic import View, TemplateView, RedirectView diff --git a/tests/regressiontests/generic_views/dates.py b/tests/regressiontests/generic_views/dates.py index a0dd867e71..5e03dbe806 100644 --- a/tests/regressiontests/generic_views/dates.py +++ b/tests/regressiontests/generic_views/dates.py @@ -1,9 +1,12 @@ +from __future__ import absolute_import + import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase -from regressiontests.generic_views.models import Book +from .models import Book + class ArchiveIndexViewTests(TestCase): fixtures = ['generic-views-test-data.json'] diff --git a/tests/regressiontests/generic_views/detail.py b/tests/regressiontests/generic_views/detail.py index c1cc2fbddb..0b5d8737dd 100644 --- a/tests/regressiontests/generic_views/detail.py +++ b/tests/regressiontests/generic_views/detail.py @@ -1,7 +1,9 @@ +from __future__ import absolute_import + from django.core.exceptions import ImproperlyConfigured from django.test import TestCase -from regressiontests.generic_views.models import Artist, Author, Page +from .models import Artist, Author, Page class DetailViewTest(TestCase): diff --git a/tests/regressiontests/generic_views/edit.py b/tests/regressiontests/generic_views/edit.py index 0adcb15afa..182615a86b 100644 --- a/tests/regressiontests/generic_views/edit.py +++ b/tests/regressiontests/generic_views/edit.py @@ -1,11 +1,14 @@ +from __future__ import absolute_import + from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django import forms from django.test import TestCase from django.utils.unittest import expectedFailure -from regressiontests.generic_views.models import Artist, Author -from regressiontests.generic_views import views +from . import views +from .models import Artist, Author + class ModelFormMixinTests(TestCase): def test_get_form(self): diff --git a/tests/regressiontests/generic_views/forms.py b/tests/regressiontests/generic_views/forms.py index 7200947781..a78242f555 100644 --- a/tests/regressiontests/generic_views/forms.py +++ b/tests/regressiontests/generic_views/forms.py @@ -1,6 +1,8 @@ +from __future__ import absolute_import + from django import forms -from regressiontests.generic_views.models import Author +from .models import Author class AuthorForm(forms.ModelForm): diff --git a/tests/regressiontests/generic_views/list.py b/tests/regressiontests/generic_views/list.py index f5bf910894..9ad00edc3b 100644 --- a/tests/regressiontests/generic_views/list.py +++ b/tests/regressiontests/generic_views/list.py @@ -1,7 +1,10 @@ +from __future__ import absolute_import + from django.core.exceptions import ImproperlyConfigured from django.test import TestCase -from regressiontests.generic_views.models import Author, Artist +from .models import Author, Artist + class ListViewTests(TestCase): fixtures = ['generic-views-test-data.json'] diff --git a/tests/regressiontests/generic_views/models.py b/tests/regressiontests/generic_views/models.py index 5445e24cee..5977258f5f 100644 --- a/tests/regressiontests/generic_views/models.py +++ b/tests/regressiontests/generic_views/models.py @@ -1,5 +1,6 @@ from django.db import models + class Artist(models.Model): name = models.CharField(max_length=100) diff --git a/tests/regressiontests/generic_views/tests.py b/tests/regressiontests/generic_views/tests.py index a4010aa7c9..d387216d41 100644 --- a/tests/regressiontests/generic_views/tests.py +++ b/tests/regressiontests/generic_views/tests.py @@ -1,5 +1,10 @@ -from regressiontests.generic_views.base import ViewTest, TemplateViewTest, RedirectViewTest -from regressiontests.generic_views.dates import ArchiveIndexViewTests, YearArchiveViewTests, MonthArchiveViewTests, WeekArchiveViewTests, DayArchiveViewTests, DateDetailViewTests -from regressiontests.generic_views.detail import DetailViewTest -from regressiontests.generic_views.edit import ModelFormMixinTests, CreateViewTests, UpdateViewTests, DeleteViewTests -from regressiontests.generic_views.list import ListViewTests +from __future__ import absolute_import + +from .base import ViewTest, TemplateViewTest, RedirectViewTest +from .dates import (ArchiveIndexViewTests, YearArchiveViewTests, + MonthArchiveViewTests, WeekArchiveViewTests, DayArchiveViewTests, + DateDetailViewTests) +from .detail import DetailViewTest +from .edit import (ModelFormMixinTests, CreateViewTests, UpdateViewTests, + DeleteViewTests) +from .list import ListViewTests diff --git a/tests/regressiontests/generic_views/urls.py b/tests/regressiontests/generic_views/urls.py index c5c63eec25..090ec73c4a 100644 --- a/tests/regressiontests/generic_views/urls.py +++ b/tests/regressiontests/generic_views/urls.py @@ -1,8 +1,10 @@ -from django.conf.urls import patterns, url -from django.views.generic import TemplateView -from django.views.decorators.cache import cache_page +from __future__ import absolute_import -import views +from django.conf.urls import patterns, url +from django.views.decorators.cache import cache_page +from django.views.generic import TemplateView + +from . import views urlpatterns = patterns('', diff --git a/tests/regressiontests/generic_views/views.py b/tests/regressiontests/generic_views/views.py index 00d00219a4..5ff9cf0e65 100644 --- a/tests/regressiontests/generic_views/views.py +++ b/tests/regressiontests/generic_views/views.py @@ -1,11 +1,13 @@ +from __future__ import absolute_import + from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic -from regressiontests.generic_views.models import Artist, Author, Book, Page -from regressiontests.generic_views.forms import AuthorForm +from .forms import AuthorForm +from .models import Artist, Author, Book, Page class CustomTemplateView(generic.TemplateView): diff --git a/tests/regressiontests/get_or_create_regress/tests.py b/tests/regressiontests/get_or_create_regress/tests.py index 103e254d4c..92c371b6f8 100644 --- a/tests/regressiontests/get_or_create_regress/tests.py +++ b/tests/regressiontests/get_or_create_regress/tests.py @@ -1,6 +1,8 @@ +from __future__ import absolute_import + from django.test import TestCase -from models import Author, Publisher +from .models import Author, Publisher class GetOrCreateTests(TestCase): diff --git a/tests/regressiontests/handlers/tests.py b/tests/regressiontests/handlers/tests.py index 40b0a8375a..59d3d84528 100644 --- a/tests/regressiontests/handlers/tests.py +++ b/tests/regressiontests/handlers/tests.py @@ -1,7 +1,7 @@ -from django.utils import unittest from django.conf import settings from django.core.handlers.wsgi import WSGIHandler from django.test import RequestFactory +from django.utils import unittest class HandlerTests(unittest.TestCase): diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py index 81065564c7..7513c46a8f 100644 --- a/tests/regressiontests/httpwrappers/tests.py +++ b/tests/regressiontests/httpwrappers/tests.py @@ -5,6 +5,7 @@ from django.http import (QueryDict, HttpResponse, SimpleCookie, BadHeaderError, parse_cookie) from django.utils import unittest + class QueryDictTests(unittest.TestCase): def test_missing_key(self): q = QueryDict('') diff --git a/tests/regressiontests/i18n/commands/compilation.py b/tests/regressiontests/i18n/commands/compilation.py index 44bb2f6ab4..98b4b33356 100644 --- a/tests/regressiontests/i18n/commands/compilation.py +++ b/tests/regressiontests/i18n/commands/compilation.py @@ -8,8 +8,8 @@ from django.core.management import CommandError from django.core.management.commands.compilemessages import compile_messages from django.test import TestCase -LOCALE='es_AR' +LOCALE='es_AR' class MessageCompilationTests(TestCase): diff --git a/tests/regressiontests/i18n/commands/extraction.py b/tests/regressiontests/i18n/commands/extraction.py index 4f476340f2..7d7cdf7485 100644 --- a/tests/regressiontests/i18n/commands/extraction.py +++ b/tests/regressiontests/i18n/commands/extraction.py @@ -2,8 +2,10 @@ import os import re import shutil -from django.test import TestCase + from django.core import management +from django.test import TestCase + LOCALE='de' diff --git a/tests/regressiontests/i18n/contenttypes/tests.py b/tests/regressiontests/i18n/contenttypes/tests.py index eb5c1718fc..79928d9e4f 100644 --- a/tests/regressiontests/i18n/contenttypes/tests.py +++ b/tests/regressiontests/i18n/contenttypes/tests.py @@ -3,10 +3,10 @@ from __future__ import with_statement import os +from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.test.utils import override_settings from django.utils import translation -from django.contrib.contenttypes.models import ContentType class ContentTypeTests(TestCase): diff --git a/tests/regressiontests/i18n/forms.py b/tests/regressiontests/i18n/forms.py index 600f252aa5..b2eb74c74c 100644 --- a/tests/regressiontests/i18n/forms.py +++ b/tests/regressiontests/i18n/forms.py @@ -1,7 +1,10 @@ +from __future__ import absolute_import + from django import forms from django.forms.extras import SelectDateWidget -from models import Company +from .models import Company + class I18nForm(forms.Form): decimal_field = forms.DecimalField(localize=True) diff --git a/tests/regressiontests/i18n/models.py b/tests/regressiontests/i18n/models.py index a302769fef..9b92705a20 100644 --- a/tests/regressiontests/i18n/models.py +++ b/tests/regressiontests/i18n/models.py @@ -1,7 +1,9 @@ from datetime import datetime + from django.db import models from django.utils.translation import ugettext_lazy as _ + class TestModel(models.Model): text = models.CharField(max_length=10, default=_('Anything')) diff --git a/tests/regressiontests/i18n/test_warnings.py b/tests/regressiontests/i18n/test_warnings.py index 60dd1a8c6f..8aac89d16c 100644 --- a/tests/regressiontests/i18n/test_warnings.py +++ b/tests/regressiontests/i18n/test_warnings.py @@ -1,5 +1,5 @@ -from os.path import join, normpath, abspath, dirname import warnings +from os.path import join, normpath, abspath, dirname import django from django.conf import settings diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 68eafbf276..fc69d9cc59 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -1,5 +1,6 @@ # -*- encoding: utf-8 -*- -from __future__ import with_statement +from __future__ import with_statement, absolute_import + import datetime import decimal import os @@ -10,24 +11,24 @@ from django.conf import settings from django.template import Template, Context from django.test import TestCase, RequestFactory from django.test.utils import override_settings +from django.utils import translation from django.utils.formats import (get_format, date_format, time_format, localize, localize_input, iter_format_modules, get_format_modules) from django.utils.importlib import import_module from django.utils.numberformat import format as nformat from django.utils.safestring import mark_safe, SafeString, SafeUnicode -from django.utils import translation from django.utils.translation import (ugettext, ugettext_lazy, activate, - deactivate, gettext_lazy, pgettext, npgettext, to_locale, - get_language_info, get_language, get_language_from_request) + deactivate, gettext_lazy, pgettext, npgettext, to_locale, + get_language_info, get_language, get_language_from_request) -from forms import I18nForm, SelectDateForm, SelectDateWidget, CompanyForm -from models import Company, TestModel +from .commands.tests import NoWrapExtractorTests, IgnoredExtractorTests, MessageCompilationTests, PoFileTests, BasicExtractorTests, JavascriptExtractorTests, CopyPluralFormsExtractorTests, SymlinkExtractorTests, ExtractorTests +from .contenttypes.tests import ContentTypeTests +from .forms import I18nForm, SelectDateForm, SelectDateWidget, CompanyForm +from .models import Company, TestModel +from .patterns.tests import URLRedirectWithoutTrailingSlashTests, URLTranslationTests, URLDisabledTests, URLTagTests, URLTestCaseBase, URLRedirectWithoutTrailingSlashSettingTests, URLNamespaceTests, URLPrefixTests, URLResponseTests, URLRedirectTests +from .test_warnings import DeprecationWarningTests -from commands.tests import * -from patterns.tests import * -from contenttypes.tests import * -from test_warnings import DeprecationWarningTests here = os.path.dirname(os.path.abspath(__file__)) diff --git a/tests/regressiontests/initial_sql_regress/models.py b/tests/regressiontests/initial_sql_regress/models.py index 6c7db2f362..76de6d3bcb 100644 --- a/tests/regressiontests/initial_sql_regress/models.py +++ b/tests/regressiontests/initial_sql_regress/models.py @@ -4,6 +4,7 @@ Regression tests for initial SQL insertion. from django.db import models + class Simple(models.Model): name = models.CharField(max_length = 50) diff --git a/tests/regressiontests/initial_sql_regress/tests.py b/tests/regressiontests/initial_sql_regress/tests.py index 1e6710be9e..815b75a9bb 100644 --- a/tests/regressiontests/initial_sql_regress/tests.py +++ b/tests/regressiontests/initial_sql_regress/tests.py @@ -1,6 +1,6 @@ from django.test import TestCase -from models import Simple +from .models import Simple class InitialSQLTests(TestCase): diff --git a/tests/regressiontests/inline_formsets/tests.py b/tests/regressiontests/inline_formsets/tests.py index b47967971a..59187ee6d0 100644 --- a/tests/regressiontests/inline_formsets/tests.py +++ b/tests/regressiontests/inline_formsets/tests.py @@ -1,7 +1,9 @@ +from __future__ import absolute_import + from django.forms.models import inlineformset_factory from django.test import TestCase -from regressiontests.inline_formsets.models import Poet, Poem, School, Parent, Child +from .models import Poet, Poem, School, Parent, Child class DeletionTests(TestCase): diff --git a/tests/regressiontests/introspection/models.py b/tests/regressiontests/introspection/models.py index ef485e3a3c..da12f6e5cb 100644 --- a/tests/regressiontests/introspection/models.py +++ b/tests/regressiontests/introspection/models.py @@ -1,5 +1,6 @@ from django.db import models + class Reporter(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) diff --git a/tests/regressiontests/introspection/tests.py b/tests/regressiontests/introspection/tests.py index fdf30126cd..1835064fcd 100644 --- a/tests/regressiontests/introspection/tests.py +++ b/tests/regressiontests/introspection/tests.py @@ -1,8 +1,11 @@ +from __future__ import absolute_import + from functools import update_wrapper + from django.db import connection from django.test import TestCase, skipUnlessDBFeature -from models import Reporter, Article +from .models import Reporter, Article # # The introspection module is optional, so methods tested here might raise diff --git a/tests/regressiontests/localflavor/au/forms.py b/tests/regressiontests/localflavor/au/forms.py index e65b92438e..aec00694fe 100644 --- a/tests/regressiontests/localflavor/au/forms.py +++ b/tests/regressiontests/localflavor/au/forms.py @@ -1,5 +1,9 @@ +from __future__ import absolute_import + from django.forms import ModelForm -from models import AustralianPlace + +from .models import AustralianPlace + class AustralianPlaceForm(ModelForm): """ Form for storing an Australian place. """ diff --git a/tests/regressiontests/localflavor/au/models.py b/tests/regressiontests/localflavor/au/models.py index 8adfa1f6f5..39061c5bb3 100644 --- a/tests/regressiontests/localflavor/au/models.py +++ b/tests/regressiontests/localflavor/au/models.py @@ -1,5 +1,5 @@ -from django.db import models from django.contrib.localflavor.au.models import AUStateField, AUPostCodeField +from django.db import models class AustralianPlace(models.Model): state = AUStateField(blank=True) diff --git a/tests/regressiontests/localflavor/au/tests.py b/tests/regressiontests/localflavor/au/tests.py index bdfaa2b799..de74b1f2b9 100644 --- a/tests/regressiontests/localflavor/au/tests.py +++ b/tests/regressiontests/localflavor/au/tests.py @@ -1,10 +1,13 @@ +from __future__ import absolute_import + import re from django.test import SimpleTestCase from django.contrib.localflavor.au.forms import (AUPostCodeField, AUPhoneNumberField, AUStateSelect) -from forms import AustralianPlaceForm +from .forms import AustralianPlaceForm + SELECTED_OPTION_PATTERN = r'