Example #1
0
def test_schema_opts_allow_none_used():
    opts = SchemaOptions(allow_none=True)

    class S(Schema):
        name = fields.String()

    schema = S()
    schema.config({'options': opts})
    assert schema.serialize({'name': None}) == {'name': None}
Example #2
0
 class Meta:
     options = SchemaOptions(output_missing=True)
Example #3
0
 class S(Schema):
     __schema_options__ = SchemaOptions(raise_errors=False)
     name = fields.String(required=True)
Example #4
0
 class Meta:
     options = SchemaOptions(allow_none=True)
Example #5
0
def test_schema_opts_cls_overrides():
    opts = SchemaOptions(allow_none=True)
    assert opts.allow_none == True
Example #6
0
def test_schema_opts_cls():
    opts = SchemaOptions()
    assert opts.allow_none == False