Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 8c0eefd066aa0e5bfe8c1006d055be8e2ad69a2b 1 parent f830166
@alex alex authored
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
View
5 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):
View
2  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):
View
6 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.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):
View
4 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)),
View
7 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):
View
7 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):
View
2  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
View
5 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']
View
4 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):
View
7 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):
View
4 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):
View
5 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']
View
1  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)
View
15 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
View
6 tests/regressiontests/generic_views/urls.py
@@ -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('',
View
6 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):
View
4 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):
View
2  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):
View
1  tests/regressiontests/httpwrappers/tests.py
@@ -5,6 +5,7 @@
parse_cookie)
from django.utils import unittest
+
class QueryDictTests(unittest.TestCase):
def test_missing_key(self):
q = QueryDict('')
View
2  tests/regressiontests/i18n/commands/compilation.py
@@ -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):
View
4 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'
View
2  tests/regressiontests/i18n/contenttypes/tests.py
@@ -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):
View
5 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)
View
2  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'))
View
2  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
View
21 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.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__))
View
1  tests/regressiontests/initial_sql_regress/models.py
@@ -4,6 +4,7 @@
from django.db import models
+
class Simple(models.Model):
name = models.CharField(max_length = 50)
View
2  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):
View
4 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):
View
1  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)
View
5 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
View
6 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. """
View
2  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)
View
5 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'<option value="%s" selected="selected">'
BLANK_OPTION_PATTERN = r'<option value="">'
View
6 tests/regressiontests/localflavor/mk/forms.py
@@ -1,5 +1,9 @@
+from __future__ import absolute_import
+
from django.forms import ModelForm
-from models import MKPerson
+
+from .models import MKPerson
+
class MKPersonForm(ModelForm):
View
3  tests/regressiontests/localflavor/mk/models.py
@@ -1,6 +1,7 @@
-from django.db import models
from django.contrib.localflavor.mk.models import (
MKIdentityCardNumberField, MKMunicipalityField, UMCNField)
+from django.db import models
+
class MKPerson(models.Model):
first_name = models.CharField(max_length = 20)
View
7 tests/regressiontests/localflavor/mk/tests.py
@@ -1,10 +1,13 @@
+from __future__ import absolute_import
+
from django.contrib.localflavor.mk.forms import (
MKIdentityCardNumberField, MKMunicipalitySelect, UMCNField)
from django.test import SimpleTestCase
-from forms import MKPersonForm
+from .forms import MKPersonForm
+
-class MKLocalflavorTests(SimpleTestCase):
+class MKLocalFlavorTests(SimpleTestCase):
def setUp(self):
self.form = MKPersonForm({
View
6 tests/regressiontests/localflavor/mx/forms.py
@@ -1,5 +1,9 @@
+from __future__ import absolute_import
+
from django.forms import ModelForm
-from models import MXPersonProfile
+
+from .models import MXPersonProfile
+
class MXPersonProfileForm(ModelForm):
View
3  tests/regressiontests/localflavor/mx/models.py
@@ -1,6 +1,7 @@
-from django.db import models
from django.contrib.localflavor.mx.models import (
MXStateField, MXRFCField, MXCURPField, MXZipCodeField)
+from django.db import models
+
class MXPersonProfile(models.Model):
state = MXStateField()
View
5 tests/regressiontests/localflavor/mx/tests.py
@@ -1,9 +1,12 @@
# -*- coding: utf-8 -*-
+from __future__ import absolute_import
+
from django.contrib.localflavor.mx.forms import (MXZipCodeField, MXRFCField,
MXStateSelect, MXCURPField)
from django.test import SimpleTestCase
-from forms import MXPersonProfileForm
+from .forms import MXPersonProfileForm
+
class MXLocalFlavorTests(SimpleTestCase):
View
86 tests/regressiontests/localflavor/tests.py
@@ -1,42 +1,44 @@
-from ar.tests import *
-from at.tests import *
-from au.tests import *
-from be.tests import *
-from br.tests import *
-from ca.tests import *
-from ch.tests import *
-from cl.tests import *
-from cn.tests import *
-from co.tests import *
-from cz.tests import *
-from de.tests import *
-from ec.tests import *
-from es.tests import *
-from fi.tests import *
-from fr.tests import *
-from gb.tests import *
-from generic.tests import *
-from hr.tests import *
-from id.tests import *
-from ie.tests import *
-from il.tests import *
-from in_.tests import *
-from is_.tests import *
-from it.tests import *
-from jp.tests import *
-from kw.tests import *
-from mk.tests import *
-from mx.tests import *
-from nl.tests import *
-from pl.tests import *
-from pt.tests import *
-from py.tests import *
-from ro.tests import *
-from ru.tests import *
-from se.tests import *
-from si.tests import *
-from sk.tests import *
-from tr.tests import *
-from us.tests import *
-from uy.tests import *
-from za.tests import *
+from __future__ import absolute_import
+
+from .ar.tests import ARLocalFlavorTests
+from .at.tests import ATLocalFlavorTests
+from .au.tests import AULocalflavorTests
+from .be.tests import BELocalFlavorTests
+from .br.tests import BRLocalFlavorTests
+from .ca.tests import CALocalFlavorTests
+from .ch.tests import CHLocalFlavorTests
+from .cl.tests import CLLocalFlavorTests
+from .cn.tests import CNLocalFlavorTests
+from .co.tests import COLocalFlavorTests
+from .cz.tests import CZLocalFlavorTests
+from .de.tests import DELocalFlavorTests
+from .ec.tests import ECLocalFlavorTests
+from .es.tests import ESLocalFlavorTests
+from .fi.tests import FILocalFlavorTests
+from .fr.tests import FRLocalFlavorTests
+from .gb.tests import GBLocalFlavorTests
+from .generic.tests import GenericLocalFlavorTests
+from .hr.tests import HRLocalFlavorTests
+from .id.tests import IDLocalFlavorTests
+from .ie.tests import IELocalFlavorTests
+from .il.tests import ILLocalFlavorTests
+from .in_.tests import INLocalFlavorTests
+from .is_.tests import ISLocalFlavorTests
+from .it.tests import ITLocalFlavorTests
+from .jp.tests import JPLocalFlavorTests
+from .kw.tests import KWLocalFlavorTests
+from .mk.tests import MKLocalFlavorTests
+from .mx.tests import MXLocalFlavorTests
+from .nl.tests import NLLocalFlavorTests
+from .pl.tests import PLLocalFlavorTests
+from .pt.tests import PTLocalFlavorTests
+from .py.tests import PYLocalFlavorTests
+from .ro.tests import ROLocalFlavorTests
+from .ru.tests import RULocalFlavorTests
+from .se.tests import SELocalFlavorTests
+from .si.tests import SILocalFlavorTests
+from .sk.tests import SKLocalFlavorTests
+from .tr.tests import TRLocalFlavorTests
+from .us.tests import USLocalFlavorTests
+from .uy.tests import UYLocalFlavorTests
+from .za.tests import ZALocalFlavorTests
View
6 tests/regressiontests/localflavor/us/forms.py
@@ -1,5 +1,9 @@
+from __future__ import absolute_import
+
from django.forms import ModelForm
-from models import USPlace
+
+from .models import USPlace
+
class USPlaceForm(ModelForm):
View
3  tests/regressiontests/localflavor/us/models.py
@@ -1,6 +1,5 @@
+from django.contrib.localflavor.us.models import USStateField, USPostalCodeField
from django.db import models
-from django.contrib.localflavor.us.models import USStateField
-from django.contrib.localflavor.us.models import USPostalCodeField
# When creating models you need to remember to add a app_label as
# 'localflavor', so your model can be found
View
7 tests/regressiontests/localflavor/us/tests.py
@@ -1,11 +1,14 @@
+from __future__ import absolute_import
+
from django.contrib.localflavor.us.forms import (USZipCodeField,
USPhoneNumberField, USStateField, USStateSelect,
USSocialSecurityNumberField)
from django.test import SimpleTestCase
-from forms import USPlaceForm
+from .forms import USPlaceForm
+
-class USLocalflavorTests(SimpleTestCase):
+class USLocalFlavorTests(SimpleTestCase):
def setUp(self):
self.form = USPlaceForm({'state':'GA', 'state_req':'NC', 'postal_code': 'GA', 'name':'impossible'})
View
6 tests/regressiontests/logging_tests/tests.py
@@ -3,11 +3,11 @@
import copy
from django.conf import compat_patch_logging_config
+from django.core import mail
from django.test import TestCase
-
-from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger
from django.test.utils import override_settings
-from django.core import mail
+from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger
+
# logging config prior to using filter with mail_admins
View
2  tests/regressiontests/m2m_regress/models.py
@@ -1,5 +1,5 @@
-from django.db import models
from django.contrib.auth import models as auth
+from django.db import models
# No related name is needed here, since symmetrical relations are not
# explicitly reversible.
View
4 tests/regressiontests/m2m_regress/tests.py
@@ -1,7 +1,9 @@
+from __future__ import absolute_import
+
from django.core.exceptions import FieldError
from django.test import TestCase
-from models import (SelfRefer, Tag, TagCollection, Entry, SelfReferChild,
+from .models import (SelfRefer, Tag, TagCollection, Entry, SelfReferChild,
SelfReferChildSibling, Worksheet)
View
3  tests/regressiontests/m2m_through_regress/models.py
@@ -1,6 +1,5 @@
-from django.db import models
-
from django.contrib.auth.models import User
+from django.db import models
# Forward declared intermediate model
View
6 tests/regressiontests/m2m_through_regress/tests.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
try:
from cStringIO import StringIO
except ImportError:
@@ -7,8 +9,8 @@
from django.contrib.auth.models import User
from django.test import TestCase
-from models import (Person, Group, Membership, UserMembership,
- Car, Driver, CarDriver)
+from .models import (Person, Group, Membership, UserMembership, Car, Driver,
+ CarDriver)
class M2MThroughTestCase(TestCase):
View
1  tests/regressiontests/managers_regress/models.py
@@ -4,6 +4,7 @@
from django.db import models
+
class OnlyFred(models.Manager):
def get_query_set(self):
return super(OnlyFred, self).get_query_set().filter(name='fred')
View
4 tests/regressiontests/managers_regress/tests.py
@@ -1,6 +1,8 @@
+from __future__ import absolute_import
+
from django.test import TestCase
-from models import Child1, Child2, Child3, Child4, Child5, Child6, Child7
+from .models import Child1, Child2, Child3, Child4, Child5, Child6, Child7
class ManagersRegressionTests(TestCase):
View
5 tests/regressiontests/many_to_one_regress/tests.py
@@ -1,7 +1,10 @@
+from __future__ import absolute_import
+
from django.db import models
from django.test import TestCase
-from models import First, Second, Third, Parent, Child, Category, Record, Relation
+from .models import First, Second, Third, Parent, Child, Category, Record, Relation
+
class ManyToOneRegressionTests(TestCase):
def test_object_creation(self):
View
1  tests/regressiontests/max_lengths/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class PersonWithDefaultMaxLengths(models.Model):
email = models.EmailField()
vcard = models.FileField(upload_to='/tmp')
View
5 tests/regressiontests/max_lengths/tests.py
@@ -1,6 +1,9 @@
+from __future__ import absolute_import
+
from django.utils import unittest
-from regressiontests.max_lengths.models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
+from .models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
+
class MaxLengthArgumentsTests(unittest.TestCase):
View
4 tests/regressiontests/middleware_exceptions/urls.py
@@ -1,7 +1,9 @@
# coding: utf-8
+from __future__ import absolute_import
+
from django.conf.urls import patterns
-import views
+from . import views
urlpatterns = patterns('',
(r'^middleware_exceptions/view/$', views.normal_view),
View
8 tests/regressiontests/model_fields/imagefield.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
import os
import shutil
@@ -5,14 +7,14 @@
from django.core.files.images import ImageFile
from django.test import TestCase
-from models import (Image, Person, PersonWithHeight, PersonWithHeightAndWidth,
- PersonDimensionsFirst, PersonTwoImages, TestImageFieldFile)
+from .models import (Image, Person, PersonWithHeight, PersonWithHeightAndWidth,
+ PersonDimensionsFirst, PersonTwoImages, TestImageFieldFile)
# If PIL available, do these tests.
if Image:
- from models import temp_storage_dir
+ from .models import temp_storage_dir
class ImageFieldTestMixin(object):
View
13 tests/regressiontests/model_fields/tests.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
import datetime
from decimal import Decimal
@@ -8,14 +10,15 @@
from django.db.models.fields.files import FieldFile
from django.utils import unittest
-from models import Foo, Bar, Whiz, BigD, BigS, Image, BigInt, Post, NullBooleanModel, BooleanModel, Document, RenamedField
+from .models import (Foo, Bar, Whiz, BigD, BigS, Image, BigInt, Post,
+ NullBooleanModel, BooleanModel, Document, RenamedField)
# If PIL available, do these tests.
if Image:
- from imagefield import (
- ImageFieldTests, ImageFieldTwoDimensionsTests, TwoImageFieldTests,
- ImageFieldNoDimensionsTests, ImageFieldOneDimensionTests,
- ImageFieldDimensionsFirstTests, ImageFieldUsingFileTests)
+ from .imagefield import (ImageFieldTests, ImageFieldTwoDimensionsTests,
+ TwoImageFieldTests, ImageFieldNoDimensionsTests,
+ ImageFieldOneDimensionTests, ImageFieldDimensionsFirstTests,
+ ImageFieldUsingFileTests)
class BasicFieldTests(test.TestCase):
View
3  tests/regressiontests/model_forms_regress/models.py
@@ -1,6 +1,7 @@
import os
-from django.db import models
+
from django.core.exceptions import ValidationError
+from django.db import models
class Person(models.Model):
View
4 tests/regressiontests/model_forms_regress/tests.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
from datetime import date
from django import forms
@@ -8,7 +10,7 @@
from django.utils import unittest
from django.test import TestCase
-from models import (Person, RealPerson, Triple, FilePathModel, Article,
+from .models import (Person, RealPerson, Triple, FilePathModel, Article,
Publication, CustomFF, Author, Author1, Homepage, Document, Edition)
View
1  tests/regressiontests/model_formsets_regress/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class User(models.Model):
username = models.CharField(max_length=12, unique=True)
serial = models.IntegerField()
View
4 tests/regressiontests/model_formsets_regress/tests.py
@@ -1,10 +1,12 @@
+from __future__ import absolute_import
+
from django import forms
from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME
from django.forms.util import ErrorDict, ErrorList
from django.forms.models import modelform_factory, inlineformset_factory, modelformset_factory, BaseModelFormSet
from django.test import TestCase
-from models import User, UserSite, Restaurant, Manager, Network, Host
+from .models import User, UserSite, Restaurant, Manager, Network, Host
class InlineFormsetTests(TestCase):
View
4 tests/regressiontests/model_inheritance_regress/tests.py
@@ -2,12 +2,14 @@
Regression tests for Model inheritance behaviour.
"""
+from __future__ import absolute_import
+
import datetime
from operator import attrgetter
from django.test import TestCase
-from models import (Place, Restaurant, ItalianRestaurant, ParkingLot,
+from .models import (Place, Restaurant, ItalianRestaurant, ParkingLot,
ParkingLot2, ParkingLot3, Supplier, Wholesaler, Child, SelfRefParent,
SelfRefChild, ArticleWithAuthor, M2MChild, QualityControl, DerivedM,
Person, BirthdayParty, BachelorParty, MessyBachelorParty,
View
1  tests/regressiontests/model_inheritance_select_related/models.py
@@ -5,6 +5,7 @@
from django.db import models
+
class Place(models.Model):
name = models.CharField(max_length=50)
View
4 tests/regressiontests/model_inheritance_select_related/tests.py
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
from operator import attrgetter
from django.test import TestCase
-from models import Restaurant, Person
+from .models import Restaurant, Person
class ModelInheritanceSelectRelatedTests(TestCase):
View
1  tests/regressiontests/model_permalink/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class Guitarist(models.Model):
name = models.CharField(max_length=50)
slug = models.CharField(max_length=50)
View
6 tests/regressiontests/model_permalink/tests.py
@@ -1,5 +1,9 @@
+from __future__ import absolute_import
+
from django.test import TestCase
-from regressiontests.model_permalink.models import Guitarist
+
+from .models import Guitarist
+
class PermalinkTests(TestCase):
urls = 'regressiontests.model_permalink.urls'
View
4 tests/regressiontests/model_regress/tests.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
import datetime
from operator import attrgetter
@@ -5,7 +7,7 @@
from django.test import TestCase, skipUnlessDBFeature
from django.utils import tzinfo
-from models import (Worker, Article, Party, Event, Department,
+from .models import (Worker, Article, Party, Event, Department,
BrokenUnicodeMethod, NonAutoPK)
View
3  tests/regressiontests/modeladmin/models.py
@@ -1,6 +1,7 @@
# coding: utf-8
-from django.db import models
from django.contrib.auth.models import User
+from django.db import models
+
class Band(models.Model):
name = models.CharField(max_length=100)
View
5 tests/regressiontests/modeladmin/tests.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
from datetime import date
from django import forms
@@ -15,8 +17,7 @@
from django.test import TestCase
from django.utils import unittest
-from models import (Band, Concert, ValidationTestModel,
- ValidationTestInlineModel)
+from .models import Band, Concert, ValidationTestModel, ValidationTestInlineModel
class MockRequest(object):
View
3  tests/regressiontests/multiple_database/models.py
@@ -1,8 +1,11 @@
+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
from django.db import models
+
class Review(models.Model):
source = models.CharField(max_length=100)
content_type = models.ForeignKey(ContentType)
View
4 tests/regressiontests/multiple_database/tests.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
import datetime
import pickle
from StringIO import StringIO
@@ -9,7 +11,7 @@
from django.db.models import signals
from django.test import TestCase
-from models import Book, Person, Pet, Review, UserProfile
+from .models import Book, Person, Pet, Review, UserProfile
class QueryTestCase(TestCase):
View
1  tests/regressiontests/null_fk/models.py
@@ -4,6 +4,7 @@
from django.db import models
+
class SystemDetails(models.Model):
details = models.TextField()
View
8 tests/regressiontests/null_fk/tests.py
@@ -1,7 +1,11 @@
-from django.test import TestCase
+from __future__ import absolute_import
+
from django.db.models import Q
+from django.test import TestCase
+
+from .models import (SystemDetails, Item, PropertyValue, SystemInfo, Forum,
+ Post, Comment)
-from regressiontests.null_fk.models import *
class NullFkTests(TestCase):
View
1  tests/regressiontests/null_fk_ordering/models.py
@@ -8,6 +8,7 @@
from django.db import models
+
# The first two models represent a very simple null FK ordering case.
class Author(models.Model):
name = models.CharField(max_length=150)
View
5 tests/regressiontests/null_fk_ordering/tests.py
@@ -1,6 +1,9 @@
+from __future__ import absolute_import
+
from django.test import TestCase
-from regressiontests.null_fk_ordering.models import *
+from .models import Author, Article, SystemInfo, Forum, Post, Comment
+
class NullFkOrderingTests(TestCase):
View
1  tests/regressiontests/null_queries/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class Poll(models.Model):
question = models.CharField(max_length=200)
View
4 tests/regressiontests/null_queries/tests.py
@@ -1,7 +1,9 @@
+from __future__ import absolute_import
+
from django.test import TestCase
from django.core.exceptions import FieldError
-from regressiontests.null_queries.models import *
+from .models import Poll, Choice, OuterA, Inner, OuterB
class NullQueriesTests(TestCase):
View
1  tests/regressiontests/one_to_one_regress/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
View
6 tests/regressiontests/one_to_one_regress/tests.py
@@ -1,5 +1,9 @@
+from __future__ import absolute_import
+
from django.test import TestCase
-from regressiontests.one_to_one_regress.models import *
+
+from .models import Place, Restaurant, Bar, Favorites, Target, UndergroundBar
+
class OneToOneRegressionTests(TestCase):
View
3  tests/regressiontests/queries/models.py
@@ -6,6 +6,7 @@
from django.db import models
+
class DumbCategory(models.Model):
pass
@@ -342,4 +343,4 @@ class OneToOneCategory(models.Model):
def __unicode__(self):
return "one2one " + self.new_name
-
+
View
13 tests/regressiontests/queries/tests.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
import datetime
import pickle
import sys
@@ -11,11 +13,12 @@
from django.utils import unittest
from django.utils.datastructures import SortedDict
-from models import (Annotation, Article, Author, Celebrity, Child, Cover, Detail,
- DumbCategory, ExtraInfo, Fan, Item, LeafA, LoopX, LoopZ, ManagedModel,
- Member, NamedCategory, Note, Number, Plaything, PointerA, Ranking, Related,
- Report, ReservedName, Tag, TvChef, Valid, X, Food, Eaten, Node, ObjectA, ObjectB,
- ObjectC, CategoryItem, SimpleCategory, SpecialCategory, OneToOneCategory)
+from .models import (Annotation, Article, Author, Celebrity, Child, Cover,
+ Detail, DumbCategory, ExtraInfo, Fan, Item, LeafA, LoopX, LoopZ,
+ ManagedModel, Member, NamedCategory, Note, Number, Plaything, PointerA,
+ Ranking, Related, Report, ReservedName, Tag, TvChef, Valid, X, Food, Eaten,
+ Node, ObjectA, ObjectB, ObjectC, CategoryItem, SimpleCategory,
+ SpecialCategory, OneToOneCategory)
class BaseQuerysetTest(TestCase):
View
4 tests/regressiontests/queryset_pickle/models.py
@@ -1,7 +1,11 @@
+from __future__ import absolute_import
+
import datetime
+
from django.db import models
from django.utils.translation import ugettext_lazy as _
+
def standalone_number(self):
return 1
View
4 tests/regressiontests/queryset_pickle/tests.py
@@ -1,9 +1,11 @@
+from __future__ import absolute_import
+
import pickle
import datetime
from django.test import TestCase
-from models import Group, Event, Happening
+from .models import Group, Event, Happening
class PickleabilityTestCase(TestCase):
View
1  tests/regressiontests/reverse_single_related/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class SourceManager(models.Manager):
def get_query_set(self):
return super(SourceManager, self).get_query_set().filter(is_public=True)
View
5 tests/regressiontests/reverse_single_related/tests.py
@@ -1,6 +1,9 @@
+from __future__ import absolute_import
+
from django.test import TestCase
-from regressiontests.reverse_single_related.models import *
+from .models import Source, Item
+
class ReverseSingleRelatedTests(TestCase):
"""
View
4 tests/regressiontests/select_related_onetoone/tests.py
@@ -1,6 +1,8 @@
+from __future__ import absolute_import
+
from django.test import TestCase
-from models import (User, UserProfile, UserStat, UserStatResult, StatDetails,
+from .models import (User, UserProfile, UserStat, UserStatResult, StatDetails,
AdvancedUserStat, Image, Product)
class ReverseSelectRelatedTestCase(TestCase):
View
1  tests/regressiontests/select_related_regress/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class Building(models.Model):
name = models.CharField(max_length=10)
View
8 tests/regressiontests/select_related_regress/tests.py
@@ -1,5 +1,11 @@
+from __future__ import absolute_import
+
from django.test import TestCase
-from regressiontests.select_related_regress.models import *
+
+from .models import (Building, Child, Device, Port, Item, Country, Connection,
+ ClientStatus, State, Client, SpecialClient, TUser, Person, Student,
+ Organizer, Class, Enrollment)
+
class SelectRelatedRegressTests(TestCase):
View
18 tests/regressiontests/serializers_regress/tests.py
@@ -8,7 +8,7 @@
"""
# 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
+from __future__ import with_statement, absolute_import
import datetime
import decimal
@@ -19,11 +19,23 @@
from django.core import serializers
from django.core.serializers import SerializerDoesNotExist
-from django.db import connection
+from django.db import connection, models
from django.test import TestCase
from django.utils.functional import curry
-from models import *
+from .models import (BooleanData, CharData, DateData, DateTimeData, EmailData,
+ FileData, FilePathData, DecimalData, FloatData, IntegerData, IPAddressData,
+ GenericIPAddressData, NullBooleanData, PhoneData, PositiveIntegerData,
+ PositiveSmallIntegerData, SlugData, SmallData, TextData, TimeData,
+ USStateData, GenericData, Anchor, UniqueAnchor, FKData, M2MData, O2OData,
+ FKSelfData, M2MSelfData, FKDataToField, FKDataToO2O, M2MIntermediateData,
+ Intermediate, BooleanPKData, CharPKData, EmailPKData, FilePathPKData,
+ DecimalPKData, FloatPKData, IntegerPKData, IPAddressPKData,
+ GenericIPAddressPKData, PhonePKData, PositiveIntegerPKData,
+ PositiveSmallIntegerPKData, SlugPKData, SmallPKData, USStatePKData,
+ AutoNowDateTimeData, ModifyingSaveData, InheritAbstractModel,
+ ExplicitInheritBaseModel, InheritBaseModel, BigIntegerData, LengthModel,
+ Tag, ComplexModel)
# A set of functions that can be used to recreate
# test data objects of various kinds.
View
2  tests/regressiontests/settings_tests/tests.py
@@ -1,5 +1,7 @@
from __future__ import with_statement
+
import os
+
from django.conf import settings, global_settings
from django.test import TransactionTestCase, TestCase, signals
from django.test.utils import override_settings
View
1  tests/regressiontests/signals_regress/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class Author(models.Model):
name = models.CharField(max_length=20)
View
7 tests/regressiontests/signals_regress/tests.py
@@ -1,7 +1,10 @@
-from django.test import TestCase
+from __future__ import absolute_import
from django.db import models
-from regressiontests.signals_regress.models import Author, Book
+from django.test import TestCase
+
+from .models import Author, Book
+
signal_output = []
View
1  tests/regressiontests/signed_cookies_tests/tests.py
@@ -4,6 +4,7 @@
from django.http import HttpRequest, HttpResponse
from django.test import TestCase
+
class SignedCookieTest(TestCase):
def test_can_set_and_read_signed_cookies(self):
View
1  tests/regressiontests/signing/tests.py
@@ -4,6 +4,7 @@
from django.test import TestCase
from django.utils.encoding import force_unicode
+
class TestSigner(TestCase):
def test_signature(self):
View
16 tests/regressiontests/sites_framework/tests.py
@@ -1,18 +1,22 @@
+from __future__ import absolute_import
+
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase
-from models import SyndicatedArticle, ExclusiveArticle, CustomArticle, InvalidArticle, ConfusedArticle
+from .models import (SyndicatedArticle, ExclusiveArticle, CustomArticle,
+ InvalidArticle, ConfusedArticle)
+
class SitesFrameworkTestCase(TestCase):
def setUp(self):
Site.objects.get_or_create(id=settings.SITE_ID, domain="example.com", name="example.com")
Site.objects.create(id=settings.SITE_ID+1, domain="example2.com", name="example2.com")
-
+
def test_site_fk(self):
article = ExclusiveArticle.objects.create(title="Breaking News!", site_id=settings.SITE_ID)
self.assertEqual(ExclusiveArticle.on_site.all().get(), article)
-
+
def test_sites_m2m(self):
article = SyndicatedArticle.objects.create(title="Fresh News!")
article.sites.add(Site.objects.get(id=settings.SITE_ID))
@@ -20,15 +24,15 @@ def test_sites_m2m(self):
article2 = SyndicatedArticle.objects.create(title="More News!")
article2.sites.add(Site.objects.get(id=settings.SITE_ID+1))
self.assertEqual(SyndicatedArticle.on_site.all().get(), article)
-
+
def test_custom_named_field(self):
article = CustomArticle.objects.create(title="Tantalizing News!", places_this_article_should_appear_id=settings.SITE_ID)
self.assertEqual(CustomArticle.on_site.all().get(), article)
-
+
def test_invalid_name(self):
article = InvalidArticle.objects.create(title="Bad News!", site_id=settings.SITE_ID)
self.assertRaises(ValueError, InvalidArticle.on_site.all)
-
+
def test_invalid_field_type(self):
article = ConfusedArticle.objects.create(title="More Bad News!", site=settings.SITE_ID)
self.assertRaises(TypeError, ConfusedArticle.on_site.all)
View
1  tests/regressiontests/special_headers/models.py
@@ -1,4 +1,5 @@
from django.db import models
+
class Article(models.Model):
text = models.TextField()
View
2  tests/regressiontests/special_headers/tests.py
@@ -1,7 +1,7 @@
import warnings
-from django.test import TestCase
from django.contrib.auth.models import User
+from django.test import TestCase
class SpecialHeadersTest(TestCase):
View
7 tests/regressiontests/special_headers/urls.py
@@ -1,8 +1,11 @@
# coding: utf-8
+from __future__ import absolute_import
+
from django.conf.urls import patterns
from django.views.generic.list_detail import object_detail
-from models import Article
-import views
+
+from . import views
+from .models import Article
urlpatterns = patterns('',
(r'^special_headers/article/(?P<object_id>\d+)/$', object_detail, {'queryset': Article.objects.all()}),
View
1  tests/regressiontests/staticfiles_tests/tests.py
@@ -1,5 +1,6 @@
# -*- encoding: utf-8 -*-
from __future__ import with_statement
+
import codecs
import os
import posixpath
View
1  tests/regressiontests/string_lookup/models.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from django.db import models
+
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
View
5 tests/regressiontests/string_lookup/tests.py
@@ -1,6 +1,9 @@
# -*- coding: utf-8 -*-
+from __future__ import absolute_import
+
from django.test import TestCase
-from regressiontests.string_lookup.models import Foo, Whiz, Bar, Article, Base, Child
+from .models import Foo, Whiz, Bar, Article, Base, Child
+
class StringLookupTests(TestCase):
View
5 tests/regressiontests/syndication/feeds.py
@@ -1,7 +1,10 @@
+from __future__ import absolute_import
+
from django.contrib.syndication import views
from django.core.exceptions import ObjectDoesNotExist
from django.utils import feedgenerator, tzinfo
-from models import Article, Entry
+
+from .models import Article, Entry
class ComplexFeed(views.Feed):
View
1  tests/regressiontests/syndication/models.py
@@ -1,5 +1,6 @@
from django.db import models
+
class Entry(models.Model):
title = models.CharField(max_length=200)
date = models.DateTimeField()
View
4 tests/regressiontests/syndication/tests.py
@@ -1,3 +1,5 @@
+from __future__ import absolute_import
+
from xml.dom import minidom
from django.contrib.syndication import views
@@ -6,7 +8,7 @@
from django.utils import tzinfo
from django.utils.feedgenerator import rfc2822_date, rfc3339_date
-from models import Entry
+from .models import Entry
class FeedTestCase(TestCase):
View
5 tests/regressiontests/syndication/urls.py
@@ -1,6 +1,9 @@
+from __future__ import absolute_import
+
from django.conf.urls import patterns
-import feeds
+from . import feeds
+
urlpatterns = patterns('django.contrib.syndication.views',
(r'^syndication/complex/(?P<foo>.*)/$', feeds.ComplexFeed()),
View
5 tests/regressiontests/templates/alternate_urls.py
@@ -1,7 +1,10 @@
# coding: utf-8
+
+from __future__ import absolute_import
+
from django.conf.urls import patterns, url
-from regressiontests.templates import views
+from . import views
urlpatterns = patterns('',
View
6 tests/regressiontests/templates/custom.py
@@ -1,6 +1,10 @@
+from __future__ import absolute_import
+
from django import template
from django.utils.unittest import TestCase
-from templatetags import custom
+
+from .templatetags import custom
+
class CustomFilterTests(TestCase):
def test_filter(self):
View
4 tests/regressiontests/templates/response.py
@@ -1,8 +1,10 @@
from __future__ import with_statement
-from datetime import datetime
+
import os
import pickle
import time
+from datetime import datetime
+
from django.utils import unittest
from django.test import RequestFactory, TestCase
from django.conf import settings
View
1  tests/regressiontests/templates/templatetags/bad_tag.py
@@ -1,5 +1,6 @@
from django import template
+
register = template.Library()
@register.tag
View
26 tests/regressiontests/templates/tests.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-from __future__ import with_statement
+from __future__ import with_statement, absolute_import
from django.conf import settings
@@ -17,10 +17,11 @@
from urlparse import urljoin
from django import template
-from django.template import base as template_base, RequestContext
+from django.template import base as template_base, RequestContext, Template, Context
from django.core import urlresolvers
from django.template import loader
from django.template.loaders import app_directories, filesystem, cached
+from django.test import RequestFactory
from django.test.utils import (get_warnings_state, restore_warnings_state,
setup_test_template_loader, restore_template_loaders, override_settings)
from django.utils import unittest
@@ -29,24 +30,25 @@
from django.utils.safestring import mark_safe
from django.utils.tzinfo import LocalTimezone
-from callables import *
-from context import ContextTests
-from custom import CustomTagTests, CustomFilterTests
-from parser import ParserTests
-from unicode import UnicodeTests
-from nodelist import NodelistTest, ErrorIndexTest
-from smartif import *
-from response import *
+from .callables import CallableVariablesTests
+from .context import ContextTests
+from .custom import CustomTagTests, CustomFilterTests
+from .parser import ParserTests
+from .unicode import UnicodeTests
+from .nodelist import NodelistTest, ErrorIndexTest
+from .smartif import SmartIfTests
+from .response import (TemplateResponseTest, BaseTemplateResponseTest,
+ CacheMiddlewareTest, SimpleTemplateResponseTest, CustomURLConfTest)
try:
- from loaders import *
+ from .loaders import RenderToStringTest, EggLoaderTest
except ImportError, e:
if "pkg_resources" in e.message:
pass # If setuptools isn't installed, that's fine. Just move on.
else:
raise
-import filters
+from . import filters
#################################
# Custom template tag for tests #
View
5 tests/regressiontests/templates/urls.py
@@ -1,6 +1,9 @@
# coding: utf-8
+from __future__ import absolute_import
+
from django.conf.urls import patterns, url
-from regressiontests.templates import views
+from . import views
+
urlpatterns = patterns('',
View
6 tests/regressiontests/test_client_regress/urls.py
@@ -1,6 +1,10 @@
+from __future__ import absolute_import
+
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
-import views
+
+from . import views
+
urlpatterns = patterns('',