diff options
| author | Matthew Tretter <m@tthewwithanm.com> | 2013-04-14 11:55:17 -0300 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2013-04-14 17:45:01 -0300 |
| commit | a506b6981bc48caec30bca3de94d2ac3e6fc1660 (patch) | |
| tree | 97ac882d257f873c5dc8a03af70e212c52aca99f /tests | |
| parent | be9ae693c46021fd3a70c0ec21dd566960b29ffb (diff) | |
Fixed #18231 -- Made JavaScript i18n not pollute global JS namespace.
Also, use Django templating for the dynamic generated JS code and use
more idiomatic coding techniques.
Thanks Matthew Tretter for the report and the patch.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/view_tests/tests/test_i18n.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/view_tests/tests/test_i18n.py b/tests/view_tests/tests/test_i18n.py index d186fab335..5a3bdd1062 100644 --- a/tests/view_tests/tests/test_i18n.py +++ b/tests/view_tests/tests/test_i18n.py @@ -61,13 +61,13 @@ class I18NTests(TestCase): else: trans_txt = catalog.ugettext('this is to be translated') response = self.client.get('/views/jsi18n/') - # in response content must to be a line like that: - # catalog['this is to be translated'] = 'same_that_trans_txt' + # response content must include a line like: + # "this is to be translated": <value of trans_txt Python variable> # javascript_quote is used to be able to check unicode strings self.assertContains(response, javascript_quote(trans_txt), 1) if lang_code == 'fr': # Message with context (msgctxt) - self.assertContains(response, "['month name\x04May'] = 'mai';", 1) + self.assertContains(response, r'"month name\u0004May": "mai"', 1) class JsI18NTests(TestCase): |
