diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-06-18 02:23:24 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-06-18 02:23:24 +0000 |
| commit | f4387422f0a556fb2469500fb9d408306bead02c (patch) | |
| tree | 2e682f6751c79c7dd301b28cd54b3109b19db25a /tests | |
| parent | 2126d41aba06b50a288cc6a516d4531ced998822 (diff) | |
unicode: Implemented comparisons between *_lazy() objects. comparing
ugettext_lazy() instances to each other now works, for example.
git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/i18n/tests.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 278957dad4..8a7d2bee3e 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -1,7 +1,9 @@ # coding: utf-8 ur""" ->>> from django.utils.translation import ugettext_lazy, activate, deactivate +Format string interpolation should work with *_lazy objects. + +>>> from django.utils.translation import ugettext_lazy, activate, deactivate, gettext_lazy >>> s = ugettext_lazy('Add %(name)s') >>> d = {'name': 'Ringo'} >>> s % d @@ -14,4 +16,18 @@ u'Ringo hinzuf\xfcgen' u'Dodaj Ringo' >>> deactivate() +It should be possible to compare *_lazy objects. + +>>> s1 = ugettext_lazy('Add %(name)s') +>>> s == s1 +True +>>> s2 = gettext_lazy('Add %(name)s') +>>> s3 = gettext_lazy('Add %(name)s') +>>> s2 == s3 +True +>>> s == s2 +True +>>> s4 = ugettext_lazy('Some other string') +>>> s == s4 +False """ |
