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" />'
def test_create(self): field = fields.File(name='test') assert field.value is None assert field.name == 'test'
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" />'
class UploadForm(Form): image = fields.File(name='upload_image')