diff options
author | Per Andersson <avtobiff@gmail.com> | 2014-01-30 01:25:11 +0100 |
---|---|---|
committer | Per Andersson <avtobiff@gmail.com> | 2014-01-30 01:25:11 +0100 |
commit | 6cff86ce6de27fbd4f9fc07716fb1205b14ffae4 (patch) | |
tree | 15d1f032fcf000801b69307d2463c10004489ee4 /bleach/tests/test_css.py | |
parent | fac84c6d90e0875e6c1b10c5ef02d577ee008af4 (diff) | |
download | python-bleach-6cff86ce6de27fbd4f9fc07716fb1205b14ffae4.tar python-bleach-6cff86ce6de27fbd4f9fc07716fb1205b14ffae4.tar.gz |
Imported Upstream version 1.4upstream/1.4
Diffstat (limited to 'bleach/tests/test_css.py')
-rw-r--r-- | bleach/tests/test_css.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bleach/tests/test_css.py b/bleach/tests/test_css.py index 588c8ce..b40596f 100644 --- a/bleach/tests/test_css.py +++ b/bleach/tests/test_css.py @@ -29,14 +29,14 @@ def test_allowed_css(): ('font-family: "Arial";', 'font-family: "Arial";', ['font-family']), ) - p_single = '<p style="%s">bar</p>' - p_double = "<p style='%s'>bar</p>" + p_single = '<p style="{0!s}">bar</p>' + p_double = "<p style='{0!s}'>bar</p>" def check(i, o, s): if '"' in i: - eq_(p_double % o, clean(p_double % i, styles=s)) + eq_(p_double.format(o), clean(p_double.format(i), styles=s)) else: - eq_(p_single % o, clean(p_single % i, styles=s)) + eq_(p_single.format(o), clean(p_single.format(i), styles=s)) for i, o, s in tests: yield check, i, o, s @@ -70,12 +70,13 @@ def test_style_hang(): """font: normal normal normal 100%/normal 'Courier New', """ """'Andale Mono', monospace; background-position: initial """ """initial; background-repeat: initial initial;""") - html = '<p style="%s">Hello world</p>' % style + html = '<p style="{0!s}">Hello world</p>'.format(style) styles = [ 'border', 'float', 'overflow', 'min-height', 'vertical-align', 'white-space', 'margin', 'margin-left', 'margin-top', 'margin-bottom', 'margin-right', - 'padding', 'padding-left', 'padding-top', 'padding-bottom', 'padding-right', + 'padding', 'padding-left', 'padding-top', 'padding-bottom', + 'padding-right', 'background', 'background-color', 'font', 'font-size', 'font-weight', 'text-align', 'text-transform', |