def test_render_no_placeholder_provided(self): block = PlaceholderCharBlock() html = block.render_form('Hello world!') self.assertInHTML( ( '<input id="" name="" placeholder="" ' 'type="text" value="Hello world!" />' ), html )
def test_render_with_placeholder(self): block = PlaceholderCharBlock(placeholder='Hi there!') html = block.render_form('Hello world!') self.assertIn( ( '<input id="" name="" placeholder="Hi there!" ' 'type="text" value="Hello world!"/>' ), html )
def test_render_no_placeholder_provided(self): block = PlaceholderCharBlock() html = block.render_form('Hello world!') self.assertIn( ( '<input id="" name="" placeholder="" ' 'type="text" value="Hello world!" />' ), html )
def test_render_returns_safetext(self): block = PlaceholderCharBlock(placeholder='Hi there!') html = block.render_form('Hello world!') self.assertIsInstance(html, SafeText)