diff options
| author | Jannis Leidel <jannis@leidel.info> | 2012-02-04 18:43:20 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2012-02-04 18:43:20 +0000 |
| commit | ef4d84d11ab9357d9c6e35b2a3a0a9d4fb310075 (patch) | |
| tree | 13f58a9d6e94a2f0169271f419abfec6b9a2df92 /tests | |
| parent | 878cc62bd49db0800e132051252b368acdeaf55a (diff) | |
Fixed #17555 -- Added support for a missing trailing slash when redirecting based on the browser language. Thanks, neaf.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17443 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/i18n/tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 77bd35bab1..27b25468d4 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -793,6 +793,18 @@ class MiscTests(TestCase): r.META = {'HTTP_ACCEPT_LANGUAGE': 'de'} self.assertEqual(g(r), 'zh-cn') + def test_get_language_from_path(self): + from django.utils.translation.trans_real import get_language_from_path as g + self.assertEqual(g('/pl/'), 'pl') + self.assertEqual(g('/pl'), 'pl') + self.assertEqual(g('/xyz/'), None) + + def test_get_language_from_path(self): + from django.utils.translation.trans_null import get_language_from_path as g + self.assertEqual(g('/pl/'), None) + self.assertEqual(g('/pl'), None) + self.assertEqual(g('/xyz/'), None) + def test_percent_in_translatable_block(self): extended_locale_paths = settings.LOCALE_PATHS + ( os.path.join(here, 'other', 'locale'), |
