コード例 #1
0
 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
     )
コード例 #2
0
 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
     )
コード例 #3
0
 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
     )
コード例 #4
0
 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
     )
コード例 #5
0
 def test_render_returns_safetext(self):
     block = PlaceholderCharBlock(placeholder='Hi there!')
     html = block.render_form('Hello world!')
     self.assertIsInstance(html, SafeText)
コード例 #6
0
 def test_render_returns_safetext(self):
     block = PlaceholderCharBlock(placeholder='Hi there!')
     html = block.render_form('Hello world!')
     self.assertIsInstance(html, SafeText)