diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-03-31 13:01:59 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-03-31 13:01:59 +0000 |
| commit | fbfaa35fb0a2a1206221e00c56cf6136cf93b6f1 (patch) | |
| tree | 02fe6440fcd421994720541a8fef8b3cf5441552 /tests | |
| parent | 95d9662f3984199062f237386a45b1a2c170f01d (diff) | |
Required that the MEDIA_URL and STATIC_URL settings end with a slash, per the deprecation timeline.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/settings_tests/tests.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/regressiontests/settings_tests/tests.py b/tests/regressiontests/settings_tests/tests.py index 48dc1a1994..0b10bb12f8 100644 --- a/tests/regressiontests/settings_tests/tests.py +++ b/tests/regressiontests/settings_tests/tests.py @@ -1,6 +1,7 @@ import os from django.conf import settings, global_settings +from django.core.exceptions import ImproperlyConfigured from django.http import HttpRequest from django.test import TransactionTestCase, TestCase, signals from django.test.utils import override_settings @@ -185,22 +186,26 @@ class TrailingSlashURLTests(TestCase): def test_no_end_slash(self): """ - MEDIA_URL raises an DeprecationWarning error if it doesn't end in a - slash. + MEDIA_URL and STATIC_URL raise an ImproperlyConfigured exception + if they doesn't end in a slash. """ - import warnings - warnings.filterwarnings('error', 'If set, MEDIA_URL must end with a slash', DeprecationWarning) - def setattr_settings(settings_module, attr, value): setattr(settings_module, attr, value) - self.assertRaises(DeprecationWarning, setattr_settings, + self.assertRaises(ImproperlyConfigured, setattr_settings, self.settings_module, 'MEDIA_URL', '/foo') - self.assertRaises(DeprecationWarning, setattr_settings, + self.assertRaises(ImproperlyConfigured, setattr_settings, self.settings_module, 'MEDIA_URL', 'http://media.foo.com') + self.assertRaises(ImproperlyConfigured, setattr_settings, + self.settings_module, 'STATIC_URL', '/foo') + + self.assertRaises(ImproperlyConfigured, setattr_settings, + self.settings_module, 'STATIC_URL', + 'http://static.foo.com') + def test_double_slash(self): """ If a MEDIA_URL ends in more than one slash, presume they know what |
