diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-31 18:28:06 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-31 18:28:06 +0000 |
| commit | 86316f0be6837e3359b63e48e518b4f7d5b4d78d (patch) | |
| tree | 53a1bd674845db0c6f12aee766546cb176b13d37 /tests/regressiontests/templates/tests.py | |
| parent | 79968f986738f5fa23973d91a931f19f59bef269 (diff) | |
Fixed #7027: template tags now corectly break tokens around strings marked for translation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates/tests.py')
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index c6e915bb56..2cfc18916f 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -130,6 +130,12 @@ class Templates(unittest.TestCase): test_template_sources('/DIR1/index.HTML', template_dirs, ['/dir1/index.html']) + def test_token_smart_split(self): + # Regression test for #7027 + token = template.Token(template.TOKEN_BLOCK, 'sometag _("Page not found") value|yesno:_("yes,no")') + split = token.split_contents() + self.assertEqual(split, ["sometag", '_("Page not found")', 'value|yesno:_("yes,no")']) + def test_templates(self): template_tests = self.get_template_tests() filter_tests = filters.get_filter_tests() |
