Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix contrib.messages tests for discovery.

  • Loading branch information...
commit 7ccbe6a4fa62c2f3f250d12e70b7db1abfa085d2 1 parent c250f9c
@carljm carljm authored
View
3  django/contrib/messages/tests/test_base.py → django/contrib/messages/tests/base.py
@@ -5,7 +5,6 @@
from django.contrib.messages.storage import default_storage, base
from django.contrib.messages.storage.base import Message
from django.core.urlresolvers import reverse
-from django.test import TestCase
from django.test.utils import override_settings
from django.utils.translation import ugettext_lazy
from django.utils.unittest import skipIf
@@ -43,7 +42,7 @@ def disable(self):
base.LEVEL_TAGS = self.old_level_tags
-class BaseTest(TestCase):
+class BaseTests(object):
storage_class = default_storage
urls = 'django.contrib.messages.tests.urls'
levels = {
View
5 django/contrib/messages/tests/test_cookie.py
@@ -1,10 +1,11 @@
import json
from django.contrib.messages import constants
-from django.contrib.messages.tests.test_base import BaseTest
+from django.contrib.messages.tests.base import BaseTests
from django.contrib.messages.storage.cookie import (CookieStorage,
MessageEncoder, MessageDecoder)
from django.contrib.messages.storage.base import Message
+from django.test import TestCase
from django.test.utils import override_settings
from django.utils.safestring import SafeData, mark_safe
@@ -41,7 +42,7 @@ def stored_cookie_messages_count(storage, response):
@override_settings(SESSION_COOKIE_DOMAIN='.example.com')
-class CookieTest(BaseTest):
+class CookieTest(BaseTests, TestCase):
storage_class = CookieStorage
def stored_messages_count(self, storage, response):
View
5 django/contrib/messages/tests/test_fallback.py
@@ -1,14 +1,15 @@
from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import (FallbackStorage,
CookieStorage)
-from django.contrib.messages.tests.test_base import BaseTest
+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
-class FallbackTest(BaseTest):
+class FallbackTest(BaseTests, TestCase):
storage_class = FallbackStorage
def get_request(self):
View
5 django/contrib/messages/tests/test_session.py
@@ -1,8 +1,9 @@
from django.contrib.messages import constants
-from django.contrib.messages.tests.test_base import BaseTest
+from django.contrib.messages.tests.base import BaseTests
from django.contrib.messages.storage.base import Message
from django.contrib.messages.storage.session import SessionStorage
from django.utils.safestring import SafeData, mark_safe
+from django.test import TestCase
def set_session_data(storage, messages):
@@ -20,7 +21,7 @@ def stored_session_messages_count(storage):
return len(data)
-class SessionTest(BaseTest):
+class SessionTest(BaseTests, TestCase):
storage_class = SessionStorage
def get_request(self):
Please sign in to comment.
Something went wrong with that request. Please try again.