Example #1
0
 def test_render_with_label(self):
     field = fields.Submit(name='test')
     assert field.render_with_label(
     ) == '<input name="test" type="submit" value="test" />'
     field_label = fields.Submit(name='test', label='My Submit')
     assert field_label.render_with_label(
     ) == '<input name="test" type="submit" value="My Submit" />'
Example #2
0
 def test_render_button_mode(self):
     field = fields.Submit(name='test', button_mode=True)
     assert str(field) == '<button name="test" type="submit">test</button>'
     field_label = fields.Submit(name='test',
                                 button_mode=True,
                                 label='My Submit')
     assert str(field_label
                ) == '<button name="test" type="submit">My Submit</button>'
Example #3
0
 def test_render_with_label_button_mode(self):
     field = fields.Submit(name='test', button_mode=True)
     assert field.render_with_label(
     ) == '<button name="test" type="submit">test</button>'
Example #4
0
 def test_render(self):
     field = fields.Submit(name='test')
     assert str(field) == '<input name="test" type="submit" value="test" />'
     field_with_value = fields.Submit(name='test', value=1)
     assert str(field_with_value
                ) == '<input name="test" type="submit" value="1" />'
Example #5
0
 def test_create(self):
     field = fields.Submit(name='test')
     assert field.value == 'test'
     assert field.name == 'test'