summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-01-17 23:10:23 +0000
committerJannis Leidel <jannis@leidel.info>2010-01-17 23:10:23 +0000
commit3a417736bc28cdf2432e30e8d035de252fddd4ec (patch)
treedb43a6202c7cc3fc9a3e7ca630b1b52d9255888d /tests/regressiontests
parentd1e7fdea3fe3e4dd28301151ef4e83fe2a2d0a1c (diff)
[1.1.X] Fixed #12230 - Updated utils.translation.to_locale to support the special sr_Latn locale. Thanks to Janos Guljas.
Backport of r12056. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12251 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/i18n/tests.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index 94e792cf54..d97ff31d48 100644
--- a/tests/regressiontests/i18n/tests.py
+++ b/tests/regressiontests/i18n/tests.py
@@ -4,7 +4,7 @@ import misc
regressions = ur"""
Format string interpolation should work with *_lazy objects.
->>> from django.utils.translation import ugettext, ugettext_lazy, activate, deactivate, gettext_lazy
+>>> from django.utils.translation import ugettext, ugettext_lazy, activate, deactivate, gettext_lazy, to_locale
>>> s = ugettext_lazy('Add %(name)s')
>>> d = {'name': 'Ringo'}
>>> s % d
@@ -17,6 +17,21 @@ u'Ringo hinzuf\xfcgen'
u'Dodaj Ringo'
>>> deactivate()
+Tests the to_locale function and the special case of Serbian Latin (refs #12230 and r11299)
+
+>>> to_locale('en-us')
+'en_US'
+>>> to_locale('sr-lat')
+'sr_Lat'
+
+Test the to_language function
+
+>>> from django.utils.translation.trans_real import to_language
+>>> to_language('en_US')
+'en-us'
+>>> to_language('sr_Lat')
+'sr-lat'
+
It should be possible to compare *_lazy objects.
>>> s1 = ugettext_lazy('Add %(name)s')