Really hidden warnings in javascript_quote tests

Refs #21725.
This commit is contained in:
Claude Paroz 2014-03-05 08:57:13 +01:00
parent 5a5815d373
commit ac699cdc17
1 changed files with 4 additions and 3 deletions

View File

@ -154,11 +154,11 @@ class TestUtilsText(SimpleTestCase):
input = "<script>alert('Hello \\xff.\n Welcome\there\r');</script>"
output = r"<script>alert(\'Hello \\xff.\n Welcome\there\r\');<\/script>"
with warnings.catch_warnings():
warnings.simplefilter("ignore", PendingDeprecationWarning)
self.assertEqual(text.javascript_quote(input), output)
# Exercising quote_double_quotes keyword argument
input = '"Text"'
with warnings.catch_warnings():
# Exercising quote_double_quotes keyword argument
input = '"Text"'
self.assertEqual(text.javascript_quote(input), '"Text"')
self.assertEqual(text.javascript_quote(input, quote_double_quotes=True),
'&quot;Text&quot;')
@ -168,6 +168,7 @@ class TestUtilsText(SimpleTestCase):
input = "<script>alert('Hello \\xff.\n Wel𝕃come\there\r');</script>"
output = r"<script>alert(\'Hello \\xff.\n Wel𝕃come\there\r\');<\/script>"
with warnings.catch_warnings():
warnings.simplefilter("ignore", PendingDeprecationWarning)
self.assertEqual(text.javascript_quote(input), output)
def test_deprecation(self):