class Target(Document): f = fields.StringField("my_field") errors = Errors()
class Address(EmbeddedDocument): afield = fields.StringField("afield")
class Target(Document): f = fields.StringField("my_field", choices=["type_a", "type_b"]) errors = Errors()
class Target(Document): f = fields.StringField("my_field", required=True, min_length=10) errors = Errors()
class Target(Document): f = fields.StringField("my_field", pattern="^This") errors = Errors()
class Target(Document): f = fields.StringField("my_field", max_length=10) errors = Errors()
def setUp(self): super(StringFieldTest, self).setUp() self.field = fields.StringField("my_field")