Permalink
Browse files

Convert the remainder of the relative imports in the tests to be abso…

…lute imports.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent f830166 commit 8c0eefd066aa0e5bfe8c1006d055be8e2ad69a2b @alex alex committed Oct 13, 2011
Showing with 576 additions and 261 deletions.
  1. +4 −1 tests/regressiontests/generic_inline_admin/admin.py
  2. +1 −1 tests/regressiontests/generic_inline_admin/models.py
  3. +4 −2 tests/regressiontests/generic_inline_admin/tests.py
  4. +3 −1 tests/regressiontests/generic_inline_admin/urls.py
  5. +4 −3 tests/regressiontests/generic_relations_regress/models.py
  6. +5 −2 tests/regressiontests/generic_relations_regress/tests.py
  7. +1 −1 tests/regressiontests/generic_views/base.py
  8. +4 −1 tests/regressiontests/generic_views/dates.py
  9. +3 −1 tests/regressiontests/generic_views/detail.py
  10. +5 −2 tests/regressiontests/generic_views/edit.py
  11. +3 −1 tests/regressiontests/generic_views/forms.py
  12. +4 −1 tests/regressiontests/generic_views/list.py
  13. +1 −0 tests/regressiontests/generic_views/models.py
  14. +10 −5 tests/regressiontests/generic_views/tests.py
  15. +4 −2 tests/regressiontests/generic_views/urls.py
  16. +4 −2 tests/regressiontests/generic_views/views.py
  17. +3 −1 tests/regressiontests/get_or_create_regress/tests.py
  18. +1 −1 tests/regressiontests/handlers/tests.py
  19. +1 −0 tests/regressiontests/httpwrappers/tests.py
  20. +1 −1 tests/regressiontests/i18n/commands/compilation.py
  21. +3 −1 tests/regressiontests/i18n/commands/extraction.py
  22. +1 −1 tests/regressiontests/i18n/contenttypes/tests.py
  23. +4 −1 tests/regressiontests/i18n/forms.py
  24. +2 −0 tests/regressiontests/i18n/models.py
  25. +1 −1 tests/regressiontests/i18n/test_warnings.py
  26. +11 −10 tests/regressiontests/i18n/tests.py
  27. +1 −0 tests/regressiontests/initial_sql_regress/models.py
  28. +1 −1 tests/regressiontests/initial_sql_regress/tests.py
  29. +3 −1 tests/regressiontests/inline_formsets/tests.py
  30. +1 −0 tests/regressiontests/introspection/models.py
  31. +4 −1 tests/regressiontests/introspection/tests.py
  32. +5 −1 tests/regressiontests/localflavor/au/forms.py
  33. +1 −1 tests/regressiontests/localflavor/au/models.py
  34. +4 −1 tests/regressiontests/localflavor/au/tests.py
  35. +5 −1 tests/regressiontests/localflavor/mk/forms.py
  36. +2 −1 tests/regressiontests/localflavor/mk/models.py
  37. +5 −2 tests/regressiontests/localflavor/mk/tests.py
  38. +5 −1 tests/regressiontests/localflavor/mx/forms.py
  39. +2 −1 tests/regressiontests/localflavor/mx/models.py
  40. +4 −1 tests/regressiontests/localflavor/mx/tests.py
  41. +44 −42 tests/regressiontests/localflavor/tests.py
  42. +5 −1 tests/regressiontests/localflavor/us/forms.py
  43. +1 −2 tests/regressiontests/localflavor/us/models.py
  44. +5 −2 tests/regressiontests/localflavor/us/tests.py
  45. +3 −3 tests/regressiontests/logging_tests/tests.py
  46. +1 −1 tests/regressiontests/m2m_regress/models.py
  47. +3 −1 tests/regressiontests/m2m_regress/tests.py
  48. +1 −2 tests/regressiontests/m2m_through_regress/models.py
  49. +4 −2 tests/regressiontests/m2m_through_regress/tests.py
  50. +1 −0 tests/regressiontests/managers_regress/models.py
  51. +3 −1 tests/regressiontests/managers_regress/tests.py
  52. +4 −1 tests/regressiontests/many_to_one_regress/tests.py
  53. +1 −0 tests/regressiontests/max_lengths/models.py
  54. +4 −1 tests/regressiontests/max_lengths/tests.py
  55. +3 −1 tests/regressiontests/middleware_exceptions/urls.py
  56. +5 −3 tests/regressiontests/model_fields/imagefield.py
  57. +8 −5 tests/regressiontests/model_fields/tests.py
  58. +2 −1 tests/regressiontests/model_forms_regress/models.py
  59. +3 −1 tests/regressiontests/model_forms_regress/tests.py
  60. +1 −0 tests/regressiontests/model_formsets_regress/models.py
  61. +3 −1 tests/regressiontests/model_formsets_regress/tests.py
  62. +3 −1 tests/regressiontests/model_inheritance_regress/tests.py
  63. +1 −0 tests/regressiontests/model_inheritance_select_related/models.py
  64. +3 −1 tests/regressiontests/model_inheritance_select_related/tests.py
  65. +1 −0 tests/regressiontests/model_permalink/models.py
  66. +5 −1 tests/regressiontests/model_permalink/tests.py
  67. +3 −1 tests/regressiontests/model_regress/tests.py
  68. +2 −1 tests/regressiontests/modeladmin/models.py
  69. +3 −2 tests/regressiontests/modeladmin/tests.py
  70. +3 −0 tests/regressiontests/multiple_database/models.py
  71. +3 −1 tests/regressiontests/multiple_database/tests.py
  72. +1 −0 tests/regressiontests/null_fk/models.py
  73. +6 −2 tests/regressiontests/null_fk/tests.py
  74. +1 −0 tests/regressiontests/null_fk_ordering/models.py
  75. +4 −1 tests/regressiontests/null_fk_ordering/tests.py
  76. +1 −0 tests/regressiontests/null_queries/models.py
  77. +3 −1 tests/regressiontests/null_queries/tests.py
  78. +1 −0 tests/regressiontests/one_to_one_regress/models.py
  79. +5 −1 tests/regressiontests/one_to_one_regress/tests.py
  80. +2 −1 tests/regressiontests/queries/models.py
  81. +8 −5 tests/regressiontests/queries/tests.py
  82. +4 −0 tests/regressiontests/queryset_pickle/models.py
  83. +3 −1 tests/regressiontests/queryset_pickle/tests.py
  84. +1 −0 tests/regressiontests/reverse_single_related/models.py
  85. +4 −1 tests/regressiontests/reverse_single_related/tests.py
  86. +3 −1 tests/regressiontests/select_related_onetoone/tests.py
  87. +1 −0 tests/regressiontests/select_related_regress/models.py
  88. +7 −1 tests/regressiontests/select_related_regress/tests.py
  89. +15 −3 tests/regressiontests/serializers_regress/tests.py
  90. +2 −0 tests/regressiontests/settings_tests/tests.py
  91. +1 −0 tests/regressiontests/signals_regress/models.py
  92. +5 −2 tests/regressiontests/signals_regress/tests.py
  93. +1 −0 tests/regressiontests/signed_cookies_tests/tests.py
  94. +1 −0 tests/regressiontests/signing/tests.py
  95. +10 −6 tests/regressiontests/sites_framework/tests.py
  96. +1 −0 tests/regressiontests/special_headers/models.py
  97. +1 −1 tests/regressiontests/special_headers/tests.py
  98. +5 −2 tests/regressiontests/special_headers/urls.py
  99. +1 −0 tests/regressiontests/staticfiles_tests/tests.py
  100. +1 −0 tests/regressiontests/string_lookup/models.py
  101. +4 −1 tests/regressiontests/string_lookup/tests.py
  102. +4 −1 tests/regressiontests/syndication/feeds.py
  103. +1 −0 tests/regressiontests/syndication/models.py
  104. +3 −1 tests/regressiontests/syndication/tests.py
  105. +4 −1 tests/regressiontests/syndication/urls.py
  106. +4 −1 tests/regressiontests/templates/alternate_urls.py
  107. +5 −1 tests/regressiontests/templates/custom.py
  108. +3 −1 tests/regressiontests/templates/response.py
  109. +1 −0 tests/regressiontests/templates/templatetags/bad_tag.py
  110. +14 −12 tests/regressiontests/templates/tests.py
  111. +4 −1 tests/regressiontests/templates/urls.py
  112. +5 −1 tests/regressiontests/test_client_regress/urls.py
  113. +3 −1 tests/regressiontests/test_runner/tests.py
  114. +2 −2 tests/regressiontests/test_utils/tests.py
  115. +3 −1 tests/regressiontests/test_utils/urls.py
  116. +5 −1 tests/regressiontests/test_utils/views.py
  117. +3 −1 tests/regressiontests/transactions_regress/tests.py
  118. +5 −1 tests/regressiontests/urlpatterns_reverse/extra_urls.py
  119. +5 −1 tests/regressiontests/urlpatterns_reverse/included_named_urls.py
  120. +5 −1 tests/regressiontests/urlpatterns_reverse/included_named_urls2.py
  121. +6 −2 tests/regressiontests/urlpatterns_reverse/included_namespace_urls.py
  122. +5 −1 tests/regressiontests/urlpatterns_reverse/included_urls.py
  123. +5 −1 tests/regressiontests/urlpatterns_reverse/included_urls2.py
  124. +4 −1 tests/regressiontests/urlpatterns_reverse/middleware.py
  125. +5 −1 tests/regressiontests/urlpatterns_reverse/named_urls.py
  126. +5 −1 tests/regressiontests/urlpatterns_reverse/namespace_urls.py
  127. +3 −1 tests/regressiontests/urlpatterns_reverse/reverse_lazy_urls.py
  128. +7 −7 tests/regressiontests/urlpatterns_reverse/tests.py
  129. +3 −1 tests/regressiontests/urlpatterns_reverse/urlconf_outer.py
  130. +5 −1 tests/regressiontests/urlpatterns_reverse/urls.py
  131. +5 −1 tests/regressiontests/urlpatterns_reverse/urls_error_handlers_callables.py
  132. +5 −1 tests/regressiontests/urlpatterns_reverse/urls_without_full_import.py
  133. +1 −1 tests/regressiontests/utils/simplelazyobject.py
  134. +21 −18 tests/regressiontests/utils/tests.py
  135. +4 −3 tests/regressiontests/views/generic_urls.py
  136. +5 −2 tests/regressiontests/views/templatetags/debugtags.py
  137. +15 −10 tests/regressiontests/views/tests/__init__.py
  138. +5 −4 tests/regressiontests/views/tests/debug.py
  139. +4 −1 tests/regressiontests/views/tests/defaults.py
  140. +4 −2 tests/regressiontests/views/tests/i18n.py
  141. +5 −2 tests/regressiontests/views/tests/static.py
  142. +3 −1 tests/regressiontests/views/urls.py
  143. +4 −3 tests/regressiontests/views/views.py
  144. +2 −1 tests/runtests.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):
@@ -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):
@@ -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.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):
@@ -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)),
@@ -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):
@@ -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):
@@ -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
@@ -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']
@@ -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):
@@ -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):
@@ -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):
@@ -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']
@@ -1,5 +1,6 @@
from django.db import models
+
class Artist(models.Model):
name = models.CharField(max_length=100)
@@ -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
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
from django.conf.urls import patterns, url
-from django.views.generic import TemplateView
from django.views.decorators.cache import cache_page
+from django.views.generic import TemplateView
-import views
+from . import views
urlpatterns = patterns('',
@@ -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):
@@ -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):
@@ -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):
@@ -5,6 +5,7 @@
parse_cookie)
from django.utils import unittest
+
class QueryDictTests(unittest.TestCase):
def test_missing_key(self):
q = QueryDict('')
@@ -8,8 +8,8 @@
from django.core.management.commands.compilemessages import compile_messages
from django.test import TestCase
-LOCALE='es_AR'
+LOCALE='es_AR'
class MessageCompilationTests(TestCase):
@@ -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'
@@ -3,10 +3,10 @@
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):
@@ -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)
@@ -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'))
@@ -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
@@ -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.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__))
@@ -4,6 +4,7 @@
from django.db import models
+
class Simple(models.Model):
name = models.CharField(max_length = 50)
@@ -1,6 +1,6 @@
from django.test import TestCase
-from models import Simple
+from .models import Simple
class InitialSQLTests(TestCase):
@@ -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):
@@ -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)
@@ -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
@@ -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. """
Oops, something went wrong.

0 comments on commit 8c0eefd

Please sign in to comment.