예제 #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}
예제 #2
0
 class Meta:
     options = SchemaOptions(output_missing=True)
예제 #3
0
 class S(Schema):
     __schema_options__ = SchemaOptions(raise_errors=False)
     name = fields.String(required=True)
예제 #4
0
 class Meta:
     options = SchemaOptions(allow_none=True)
예제 #5
0
def test_schema_opts_cls_overrides():
    opts = SchemaOptions(allow_none=True)
    assert opts.allow_none == True
예제 #6
0
def test_schema_opts_cls():
    opts = SchemaOptions()
    assert opts.allow_none == False