diff --git a/django/contrib/messages/tests/base.py b/django/contrib/messages/tests/base.py
index 8d04532..463a15f 100644
a
|
b
|
class BaseTest(TestCase):
|
56 | 56 | |
57 | 57 | def setUp(self): |
58 | 58 | self.settings_override = override_settings_tags( |
| 59 | DEBUG_PROPAGATE_EXCEPTIONS = True, |
59 | 60 | TEMPLATE_DIRS = (), |
60 | 61 | MESSAGE_TAGS = '', |
61 | 62 | MESSAGE_STORAGE = '%s.%s' % (self.storage_class.__module__, |
diff --git a/django/contrib/messages/tests/cookie.py b/django/contrib/messages/tests/cookie.py
index f22ed39..30aa6b5 100644
a
|
b
|
from django.contrib.messages.tests.base import BaseTest
|
3 | 3 | from django.contrib.messages.storage.cookie import (CookieStorage, |
4 | 4 | MessageEncoder, MessageDecoder) |
5 | 5 | from django.contrib.messages.storage.base import Message |
| 6 | from django.test.utils import override_settings |
6 | 7 | from django.utils import simplejson as json |
7 | | from django.conf import settings |
8 | 8 | |
9 | 9 | |
10 | 10 | def set_cookie_data(storage, messages, invalid=False, encode_empty=False): |
… |
… |
def stored_cookie_messages_count(storage, response):
|
41 | 41 | class CookieTest(BaseTest): |
42 | 42 | storage_class = CookieStorage |
43 | 43 | |
44 | | def setUp(self): |
45 | | super(CookieTest, self).setUp() |
46 | | self.old_SESSION_COOKIE_DOMAIN = settings.SESSION_COOKIE_DOMAIN |
47 | | settings.SESSION_COOKIE_DOMAIN = '.lawrence.com' |
48 | | |
49 | | def tearDown(self): |
50 | | super(CookieTest, self).tearDown() |
51 | | settings.SESSION_COOKIE_DOMAIN = self.old_SESSION_COOKIE_DOMAIN |
52 | | |
53 | 44 | def stored_messages_count(self, storage, response): |
54 | 45 | return stored_cookie_messages_count(storage, response) |
55 | 46 | |
… |
… |
class CookieTest(BaseTest):
|
139 | 130 | value = encoder.encode(messages) |
140 | 131 | decoded_messages = json.loads(value, cls=MessageDecoder) |
141 | 132 | self.assertEqual(messages, decoded_messages) |
| 133 | |
| 134 | CookieTest = override_settings( |
| 135 | SESSION_COOKIE_DOMAIN='.lawrence.com')(CookieTest) |