parent
5a5815d373
commit
ac699cdc17
|
@ -154,11 +154,11 @@ class TestUtilsText(SimpleTestCase):
|
||||||
input = "<script>alert('Hello \\xff.\n Welcome\there\r');</script>"
|
input = "<script>alert('Hello \\xff.\n Welcome\there\r');</script>"
|
||||||
output = r"<script>alert(\'Hello \\xff.\n Welcome\there\r\');<\/script>"
|
output = r"<script>alert(\'Hello \\xff.\n Welcome\there\r\');<\/script>"
|
||||||
with warnings.catch_warnings():
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore", PendingDeprecationWarning)
|
||||||
self.assertEqual(text.javascript_quote(input), output)
|
self.assertEqual(text.javascript_quote(input), output)
|
||||||
|
|
||||||
# Exercising quote_double_quotes keyword argument
|
# Exercising quote_double_quotes keyword argument
|
||||||
input = '"Text"'
|
input = '"Text"'
|
||||||
with warnings.catch_warnings():
|
|
||||||
self.assertEqual(text.javascript_quote(input), '"Text"')
|
self.assertEqual(text.javascript_quote(input), '"Text"')
|
||||||
self.assertEqual(text.javascript_quote(input, quote_double_quotes=True),
|
self.assertEqual(text.javascript_quote(input, quote_double_quotes=True),
|
||||||
'"Text"')
|
'"Text"')
|
||||||
|
@ -168,6 +168,7 @@ class TestUtilsText(SimpleTestCase):
|
||||||
input = "<script>alert('Hello \\xff.\n Wel𝕃come\there\r');</script>"
|
input = "<script>alert('Hello \\xff.\n Wel𝕃come\there\r');</script>"
|
||||||
output = r"<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():
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore", PendingDeprecationWarning)
|
||||||
self.assertEqual(text.javascript_quote(input), output)
|
self.assertEqual(text.javascript_quote(input), output)
|
||||||
|
|
||||||
def test_deprecation(self):
|
def test_deprecation(self):
|
||||||
|
|
Loading…
Reference in New Issue