diff options
| author | Jannis Leidel <jannis@leidel.info> | 2011-03-02 21:37:29 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2011-03-02 21:37:29 +0000 |
| commit | b34a08e07019eca965d48a15caebcc9cc90b0edc (patch) | |
| tree | 43005db2060fcf81af9bfdcaa94807ff96c82e58 /tests | |
| parent | 7207481aa8d19abf4dc9acee2c9583fe59f09e8e (diff) | |
[1.2.X] Fixed #15535 -- Stopped the blocktrans template tag from raising a KeyError if an included variable can't be found in the context. Thanks, melinath.
Backport from trunk (r15709).
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index 7a3de22f57..ba1a5809f2 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -1138,6 +1138,9 @@ class Templates(unittest.TestCase): # translation of singular form in russian (#14126) 'i18n27': ('{% load i18n %}{% blocktrans count number as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %}', {'number': 1, 'LANGUAGE_CODE': 'ru'}, u'1 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442'), + # blocktrans handling of variables which are not in the context. + 'i18n34': ('{% load i18n %}{% blocktrans %}{{ missing }}{% endblocktrans %}', {}, u''), + ### HANDLING OF TEMPLATE_STRING_IF_INVALID ################################### 'invalidstr01': ('{{ var|default:"Foo" }}', {}, ('Foo','INVALID')), |
