summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-03-15 08:06:47 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-03-15 08:06:47 +0000
commitc64669a6140444cd799d1b9bc826e67ae8b0d55a (patch)
treebc8a737adf7597d4d82e459157fb85a4cb48cd0d /tests
parentd3ee5566b4804f40e4cf5e86e4bdb5b2c629b8a2 (diff)
[1.1.X] Fixed #13114 -- Modified escapejs to produce output that is JSON compliant. Thanks to David Danier for the report.
Backport of r12780 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12781 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/defaultfilters/tests.py8
-rw-r--r--tests/regressiontests/templates/filters.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py
index 0fe4673063..abc080db48 100644
--- a/tests/regressiontests/defaultfilters/tests.py
+++ b/tests/regressiontests/defaultfilters/tests.py
@@ -72,16 +72,16 @@ u'\\\\ : backslashes, too'
u'Hello world'
>>> escapejs(u'"double quotes" and \'single quotes\'')
-u'\\x22double quotes\\x22 and \\x27single quotes\\x27'
+u'\\u0022double quotes\\u0022 and \\u0027single quotes\\u0027'
>>> escapejs(ur'\ : backslashes, too')
-u'\\x5C : backslashes, too'
+u'\\u005C : backslashes, too'
>>> escapejs(u'and lots of whitespace: \r\n\t\v\f\b')
-u'and lots of whitespace: \\x0D\\x0A\\x09\\x0B\\x0C\\x08'
+u'and lots of whitespace: \\u000D\\u000A\\u0009\\u000B\\u000C\\u0008'
>>> escapejs(ur'<script>and this</script>')
-u'\\x3Cscript\\x3Eand this\\x3C/script\\x3E'
+u'\\u003Cscript\\u003Eand this\\u003C/script\\u003E'
>>> escapejs(u'paragraph separator:\u2029and line separator:\u2028')
u'paragraph separator:\\u2029and line separator:\\u2028'
diff --git a/tests/regressiontests/templates/filters.py b/tests/regressiontests/templates/filters.py
index c02a161014..adff2c6973 100644
--- a/tests/regressiontests/templates/filters.py
+++ b/tests/regressiontests/templates/filters.py
@@ -295,8 +295,8 @@ def get_filter_tests():
'autoescape-stringfilter03': (r'{{ safe|capfirst }}', {'safe': SafeClass()}, 'You &gt; me'),
'autoescape-stringfilter04': (r'{% autoescape off %}{{ safe|capfirst }}{% endautoescape %}', {'safe': SafeClass()}, 'You &gt; me'),
- 'escapejs01': (r'{{ a|escapejs }}', {'a': 'testing\r\njavascript \'string" <b>escaping</b>'}, 'testing\\x0D\\x0Ajavascript \\x27string\\x22 \\x3Cb\\x3Eescaping\\x3C/b\\x3E'),
- 'escapejs02': (r'{% autoescape off %}{{ a|escapejs }}{% endautoescape %}', {'a': 'testing\r\njavascript \'string" <b>escaping</b>'}, 'testing\\x0D\\x0Ajavascript \\x27string\\x22 \\x3Cb\\x3Eescaping\\x3C/b\\x3E'),
+ 'escapejs01': (r'{{ a|escapejs }}', {'a': 'testing\r\njavascript \'string" <b>escaping</b>'}, 'testing\\u000D\\u000Ajavascript \\u0027string\\u0022 \\u003Cb\\u003Eescaping\\u003C/b\\u003E'),
+ 'escapejs02': (r'{% autoescape off %}{{ a|escapejs }}{% endautoescape %}', {'a': 'testing\r\njavascript \'string" <b>escaping</b>'}, 'testing\\u000D\\u000Ajavascript \\u0027string\\u0022 \\u003Cb\\u003Eescaping\\u003C/b\\u003E'),
# length filter.