def test_formattedstring_field(self): field = fields.FormattedString('Hello {name}') user = User(name='Monty') assert field.serialize('name', user) == 'Hello Monty'
class MySchema(Schema): greeting = fields.FormattedString('Hello {name}')
def test_metadata_may_be_added_to_formatted_string_field(self): field = fields.FormattedString('hello {name}', description='a greeting') assert field.metadata == {'description': 'a greeting'}