diff --git a/django/contrib/messages/tests/__init__.py b/tests/messages_tests/__init__.py similarity index 100% rename from django/contrib/messages/tests/__init__.py rename to tests/messages_tests/__init__.py diff --git a/django/contrib/messages/tests/base.py b/tests/messages_tests/base.py similarity index 97% rename from django/contrib/messages/tests/base.py rename to tests/messages_tests/base.py index d1f951789f..ad2d77cafb 100644 --- a/django/contrib/messages/tests/base.py +++ b/tests/messages_tests/base.py @@ -1,7 +1,4 @@ -from unittest import skipUnless - from django import http -from django.apps import apps from django.contrib.messages import constants, get_level, set_level, utils from django.contrib.messages.api import MessageFailure from django.contrib.messages.constants import DEFAULT_LEVELS @@ -12,12 +9,6 @@ from django.test import modify_settings, override_settings from django.utils.translation import ugettext_lazy -def skipUnlessAuthIsInstalled(func): - return skipUnless( - apps.is_installed('django.contrib.auth'), - "django.contrib.auth isn't installed")(func) - - def add_level_messages(storage): """ Adds 6 messages from different levels (including a custom one) to a storage @@ -68,7 +59,7 @@ class BaseTests(object): ), }, }], - ROOT_URLCONF='django.contrib.messages.tests.urls', + ROOT_URLCONF='messages_tests.urls', MESSAGE_TAGS='', MESSAGE_STORAGE='%s.%s' % (self.storage_class.__module__, self.storage_class.__name__), diff --git a/django/contrib/messages/tests/test_api.py b/tests/messages_tests/test_api.py similarity index 100% rename from django/contrib/messages/tests/test_api.py rename to tests/messages_tests/test_api.py diff --git a/django/contrib/messages/tests/test_cookie.py b/tests/messages_tests/test_cookie.py similarity index 99% rename from django/contrib/messages/tests/test_cookie.py rename to tests/messages_tests/test_cookie.py index c986a174ca..1ce04bd691 100644 --- a/django/contrib/messages/tests/test_cookie.py +++ b/tests/messages_tests/test_cookie.py @@ -5,10 +5,11 @@ from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.cookie import ( CookieStorage, MessageDecoder, MessageEncoder, ) -from django.contrib.messages.tests.base import BaseTests from django.test import TestCase, override_settings from django.utils.safestring import SafeData, mark_safe +from .base import BaseTests + def set_cookie_data(storage, messages, invalid=False, encode_empty=False): """ diff --git a/django/contrib/messages/tests/test_fallback.py b/tests/messages_tests/test_fallback.py similarity index 96% rename from django/contrib/messages/tests/test_fallback.py rename to tests/messages_tests/test_fallback.py index 0afbe75ae6..a57acc728a 100644 --- a/django/contrib/messages/tests/test_fallback.py +++ b/tests/messages_tests/test_fallback.py @@ -2,15 +2,12 @@ from django.contrib.messages import constants from django.contrib.messages.storage.fallback import ( CookieStorage, FallbackStorage, ) -from django.contrib.messages.tests.base import BaseTests -from django.contrib.messages.tests.test_cookie import ( - set_cookie_data, stored_cookie_messages_count, -) -from django.contrib.messages.tests.test_session import ( - set_session_data, stored_session_messages_count, -) from django.test import TestCase +from .base import BaseTests +from .test_cookie import set_cookie_data, stored_cookie_messages_count +from .test_session import set_session_data, stored_session_messages_count + class FallbackTest(BaseTests, TestCase): storage_class = FallbackStorage diff --git a/django/contrib/messages/tests/test_middleware.py b/tests/messages_tests/test_middleware.py similarity index 100% rename from django/contrib/messages/tests/test_middleware.py rename to tests/messages_tests/test_middleware.py diff --git a/django/contrib/messages/tests/test_mixins.py b/tests/messages_tests/test_mixins.py similarity index 77% rename from django/contrib/messages/tests/test_mixins.py rename to tests/messages_tests/test_mixins.py index bb0bb797d4..a90a37e98b 100644 --- a/django/contrib/messages/tests/test_mixins.py +++ b/tests/messages_tests/test_mixins.py @@ -1,9 +1,10 @@ -from django.contrib.messages.tests.urls import ContactFormViewWithMsg from django.core.urlresolvers import reverse from django.test import TestCase, override_settings +from .urls import ContactFormViewWithMsg -@override_settings(ROOT_URLCONF='django.contrib.messages.tests.urls') + +@override_settings(ROOT_URLCONF='messages_tests.urls') class SuccessMessageMixinTests(TestCase): def test_set_messages_success(self): diff --git a/django/contrib/messages/tests/test_session.py b/tests/messages_tests/test_session.py similarity index 96% rename from django/contrib/messages/tests/test_session.py rename to tests/messages_tests/test_session.py index cca659d3d8..3d211f6f8d 100644 --- a/django/contrib/messages/tests/test_session.py +++ b/tests/messages_tests/test_session.py @@ -1,10 +1,11 @@ from django.contrib.messages import constants from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.session import SessionStorage -from django.contrib.messages.tests.base import BaseTests from django.test import TestCase from django.utils.safestring import SafeData, mark_safe +from .base import BaseTests + def set_session_data(storage, messages): """ diff --git a/django/contrib/messages/tests/urls.py b/tests/messages_tests/urls.py similarity index 100% rename from django/contrib/messages/tests/urls.py rename to tests/messages_tests/urls.py