Ejemplo n.º 1
0
 def test_render_with_label(self):
     field = fields.File(name='test')
     assert field.render_with_label(
     ) == '<label for="test">test</label><input id="test" name="test" type="file" />'
Ejemplo n.º 2
0
 def test_create(self):
     field = fields.File(name='test')
     assert field.value is None
     assert field.name == 'test'
Ejemplo n.º 3
0
 def test_render(self):
     field = fields.File(name='test')
     assert str(field) == '<input name="test" type="file" />'
     field_with_value = fields.File(name='test', value=1)
     assert str(field_with_value) == '<input name="test" type="file" />'
Ejemplo n.º 4
0
class UploadForm(Form):
    image = fields.File(name='upload_image')