<s> from django . template import TemplateSyntaxError <EOL> from nose . tools import eq_ , assert_false , raises , assert_not_equal <EOL> from . import imagegenerators <EOL> from . utils import render_tag , get_html_attrs <EOL> def test_img_tag ( ) : <EOL> ttag = r"""<STR_LIT>""" <EOL> attrs = get_html_attrs ( ttag ) <EOL> expected_attrs = set ( [ '<STR_LIT:src>' , '<STR_LIT:width>' , '<STR_LIT>' ] ) <EOL> eq_ ( set ( attrs . keys ( ) ) , expected_attrs ) <EOL> for k in expected_attrs : <EOL> assert_not_equal ( attrs [ k ] . strip ( ) , '<STR_LIT>' ) <EOL> def test_img_tag_attrs ( ) : <EOL> ttag = r"""<STR_LIT>""" <EOL> attrs = get_html_attrs ( ttag ) <EOL> eq_ ( attrs . get ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> @ raises ( TemplateSyntaxError ) <EOL> def test_dangling_html_attrs_delimiter ( ) : <EOL> ttag = r"""<STR_LIT>""" <EOL> render_tag ( ttag ) <EOL> @ raises ( TemplateSyntaxError ) <EOL> def test_html_attrs_assignment ( ) : <EOL> """<STR_LIT>""" <EOL> ttag = r"""<STR_LIT>""" <EOL> render_tag ( ttag ) <EOL> def test_single_dimension_attr ( ) : <EOL> """<STR_LIT>""" <EOL> ttag = r"""<STR_LIT>""" <EOL> attrs = get_html_attrs ( ttag ) <EOL> assert_false ( '<STR_LIT>' in attrs ) <EOL> def test_assignment_tag ( ) : <EOL> ttag = r"""<STR_LIT>""" <EOL> html = render_tag ( ttag ) <EOL> assert_not_equal ( html . strip ( ) , '<STR_LIT>' ) </s>
