aboutsummaryrefslogtreecommitdiff
path: root/bleach/tests/test_security.py
diff options
context:
space:
mode:
authorPer Andersson <avtobiff@gmail.com>2014-01-30 01:25:15 +0100
committerPer Andersson <avtobiff@gmail.com>2014-01-30 01:25:15 +0100
commitc084fbcb2e2f2f167c8d65ca1ecfee406f14c24b (patch)
tree6c5ca20a48eb50ea000748abb5374247d6de1888 /bleach/tests/test_security.py
parent973d326d7847161827a8f75b5f589008a83a342d (diff)
parent6cff86ce6de27fbd4f9fc07716fb1205b14ffae4 (diff)
downloadpython-bleach-c084fbcb2e2f2f167c8d65ca1ecfee406f14c24b.tar
python-bleach-c084fbcb2e2f2f167c8d65ca1ecfee406f14c24b.tar.gz
Merge tag 'upstream/1.4'
Upstream version 1.4 # gpg: Signature made Thu 30 Jan 2014 01:25:12 AM CET using RSA key ID 79F492F8 # gpg: Good signature from "Per Andersson <avtobiff@fripost.org>" # gpg: aka "Per Andersson <avtobiff@debian.org>" # gpg: aka "Per Andersson <avtobiff@gmail.com>" # gpg: aka "Per Andersson <avtobiff@foo.nu>"
Diffstat (limited to 'bleach/tests/test_security.py')
-rw-r--r--bleach/tests/test_security.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bleach/tests/test_security.py b/bleach/tests/test_security.py
index 6c2b33f..6adab59 100644
--- a/bleach/tests/test_security.py
+++ b/bleach/tests/test_security.py
@@ -25,10 +25,10 @@ def test_invalid_attr():
clean('<a onclick="evil" href="test">test</a>'))
eq_('<img src="test">',
clean('<img onclick="evil" src="test" />',
- tags=IMG, attributes=IMG_ATTR))
+ tags=IMG, attributes=IMG_ATTR))
eq_('<img src="test">',
clean('<img href="invalid" src="test" />',
- tags=IMG, attributes=IMG_ATTR))
+ tags=IMG, attributes=IMG_ATTR))
def test_unquoted_attr():
@@ -57,7 +57,7 @@ def test_invalid_filter_attr():
eq_('<img src="http://example.com/">',
clean('<img onclick="evil" src="http://example.com/" />',
- tags=IMG, attributes=IMG_ATTR))
+ tags=IMG, attributes=IMG_ATTR))
eq_('<img>', clean('<img onclick="evil" src="http://badhost.com/" />',
tags=IMG, attributes=IMG_ATTR))
@@ -91,9 +91,9 @@ def test_nasty():
"""Nested, broken up, multiple tags, are still foiled!"""
test = ('<scr<script></script>ipt type="text/javascript">alert("foo");</'
'<script></script>script<del></del>>')
- expect = (u'&lt;scr&lt;script&gt;&lt;/script&gt;ipt type="text/javascript"'
- u'&gt;alert("foo");&lt;/script&gt;script&lt;del&gt;&lt;/del&gt;'
- u'&gt;')
+ expect = ('&lt;scr&lt;script&gt;&lt;/script&gt;ipt type="text/javascript"'
+ '&gt;alert("foo");&lt;/script&gt;script&lt;del&gt;&lt;/del&gt;'
+ '&gt;')
eq_(expect, clean(test))