Add comments for encoded test strings.

This commit is contained in:
Carlton Gibson 2017-11-06 11:23:38 +01:00 committed by GitHub
parent e687e70de3
commit 82e59947b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,6 +213,7 @@ class UrlsReplaceQueryParamTests(TestCase):
Tests the replace_query_param functionality. Tests the replace_query_param functionality.
""" """
def test_valid_unicode_preserved(self): def test_valid_unicode_preserved(self):
# Encoded string: '查询'
q = '/?q=%E6%9F%A5%E8%AF%A2' q = '/?q=%E6%9F%A5%E8%AF%A2'
new_key = 'page' new_key = 'page'
new_value = 2 new_value = 2
@ -231,6 +232,7 @@ class UrlsReplaceQueryParamTests(TestCase):
assert value in replace_query_param(q, new_key, new_value) assert value in replace_query_param(q, new_key, new_value)
def test_invalid_unicode(self): def test_invalid_unicode(self):
# Encoded string: '<27><><script>alert(313)</script>=1'
q = '/e/?%FF%FE%3C%73%63%72%69%70%74%3E%61%6C%65%72%74%28%33%31%33%29%3C%2F%73%63%72%69%70%74%3E=1' q = '/e/?%FF%FE%3C%73%63%72%69%70%74%3E%61%6C%65%72%74%28%33%31%33%29%3C%2F%73%63%72%69%70%74%3E=1'
key = 'from' key = 'from'
value = 'login' value = 'login'