diff options
| author | Jannis Leidel <jannis@leidel.info> | 2010-02-21 23:43:28 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2010-02-21 23:43:28 +0000 |
| commit | 84f8213d74817b8d5aaf81dfa611e919d5266360 (patch) | |
| tree | d45bfd051b27d13d3c7c7fb54e142b3b4bbebd96 /tests/regressiontests/templates/tests.py | |
| parent | b459f5b7e3be65bbd554e03626ff255d4a68e9fc (diff) | |
Fixed #5972 - Allow the template filters to be used with the trans tag. Thanks for the initial patch, Dmitri Fedortchenko.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12472 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates/tests.py')
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index 925fc57084..22e4e45d98 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -907,6 +907,11 @@ class Templates(unittest.TestCase): 'i18n21': ('{% load i18n %}{% blocktrans %}{{ andrew }}{% endblocktrans %}', {'andrew': mark_safe('a & b')}, u'a & b'), 'i18n22': ('{% load i18n %}{% trans andrew %}', {'andrew': mark_safe('a & b')}, u'a & b'), + # Use filters with the {% trans %} tag, #5972 + 'i18n23': ('{% load i18n %}{% trans "Page not found"|capfirst|slice:"6:" %}', {'LANGUAGE_CODE': 'de'}, u'nicht gefunden'), + 'i18n24': ("{% load i18n %}{% trans 'Page not found'|upper %}", {'LANGUAGE_CODE': 'de'}, u'SEITE NICHT GEFUNDEN'), + 'i18n25': ('{% load i18n %}{% trans somevar|upper %}', {'somevar': 'Page not found', 'LANGUAGE_CODE': 'de'}, u'SEITE NICHT GEFUNDEN'), + ### HANDLING OF TEMPLATE_STRING_IF_INVALID ################################### 'invalidstr01': ('{{ var|default:"Foo" }}', {}, ('Foo','INVALID')), |
