diff --git a/django/contrib/messages/tests/base.py b/django/contrib/messages/tests/base.py
index 8d04532..64fe1ed 100644
a
|
b
|
|
1 | 1 | from django import http |
2 | | from django.conf import settings |
| 2 | from django.conf import settings, global_settings |
3 | 3 | from django.contrib.messages import constants, utils, get_level, set_level |
4 | 4 | from django.contrib.messages.api import MessageFailure |
5 | 5 | from django.contrib.messages.storage import default_storage, base |
… |
… |
class BaseTest(TestCase):
|
57 | 57 | def setUp(self): |
58 | 58 | self.settings_override = override_settings_tags( |
59 | 59 | TEMPLATE_DIRS = (), |
| 60 | TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS, |
60 | 61 | MESSAGE_TAGS = '', |
61 | 62 | MESSAGE_STORAGE = '%s.%s' % (self.storage_class.__module__, |
62 | 63 | self.storage_class.__name__), |
diff --git a/django/contrib/sitemaps/tests/basic.py b/django/contrib/sitemaps/tests/basic.py
index 775e0d9..319ac94 100644
a
|
b
|
from django.contrib.sitemaps import Sitemap, GenericSitemap
|
6 | 6 | from django.contrib.sites.models import Site |
7 | 7 | from django.core.exceptions import ImproperlyConfigured |
8 | 8 | from django.test import TestCase |
| 9 | from django.test.utils import override_settings |
9 | 10 | from django.utils.unittest import skipUnless |
10 | 11 | from django.utils.formats import localize |
11 | 12 | from django.utils.translation import activate, deactivate |
… |
… |
class SitemapTests(TestCase):
|
19 | 20 | self.base_url = 'http://example.com' |
20 | 21 | else: |
21 | 22 | self.base_url = 'http://testserver' |
22 | | self.old_USE_L10N = settings.USE_L10N |
23 | 23 | self.old_Site_meta_installed = Site._meta.installed |
24 | | self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS |
25 | | self.old_Site_meta_installed = Site._meta.installed |
26 | | settings.TEMPLATE_DIRS = ( |
27 | | os.path.join(os.path.dirname(__file__), 'templates'), |
28 | | ) |
29 | 24 | # Create a user that will double as sitemap content |
30 | 25 | User.objects.create_user('testuser', 'test@example.com', 's3krit') |
31 | 26 | |
32 | 27 | def tearDown(self): |
33 | | settings.USE_L10N = self.old_USE_L10N |
34 | | Site._meta.installed = self.old_Site_meta_installed |
35 | | settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS |
36 | 28 | Site._meta.installed = self.old_Site_meta_installed |
37 | 29 | |
38 | 30 | def test_simple_sitemap_index(self): |
… |
… |
class SitemapTests(TestCase):
|
46 | 38 | </sitemapindex> |
47 | 39 | """ % self.base_url) |
48 | 40 | |
| 41 | @override_settings( |
| 42 | TEMPLATE_DIRS=(os.path.join(os.path.dirname(__file__), 'templates'),)) |
49 | 43 | def test_simple_sitemap_custom_index(self): |
50 | 44 | "A simple sitemap index can be rendered with a custom template" |
51 | 45 | # Retrieve the sitemap. |
… |
… |
class SitemapTests(TestCase):
|
69 | 63 | </urlset> |
70 | 64 | """ % (self.base_url, date.today())) |
71 | 65 | |
| 66 | @override_settings( |
| 67 | TEMPLATE_DIRS=(os.path.join(os.path.dirname(__file__), 'templates'),)) |
72 | 68 | def test_simple_custom_sitemap(self): |
73 | 69 | "A simple sitemap can be rendered with a custom template" |
74 | 70 | # Retrieve the sitemap. |
… |
… |
class SitemapTests(TestCase):
|
82 | 78 | """ % (self.base_url, date.today())) |
83 | 79 | |
84 | 80 | @skipUnless(settings.USE_I18N, "Internationalization is not enabled") |
| 81 | @override_settings(USE_L10N=True) |
85 | 82 | def test_localized_priority(self): |
86 | 83 | "The priority value should not be localized (Refs #14164)" |
87 | | # Localization should be active |
88 | | settings.USE_L10N = True |
89 | 84 | activate('fr') |
90 | 85 | self.assertEqual(u'0,3', localize(0.3)) |
91 | 86 | |