예제 #1
0
    def test_validate_only_if_not_none(self):
        field = StringField(required=False)

        expect(field.validate(None)).to_be_true()
예제 #2
0
    def test_validate_enforces_maxlength(self):
        field = StringField(max_length=5)

        expect(field.validate("-----")).to_be_true()
        expect(field.validate("-----" * 2)).to_be_false()
예제 #3
0
    def test_validate_enforces_maxlength(self):
        field = StringField(max_length=5)

        expect(field.validate("-----")).to_be_true()
        expect(field.validate("-----" * 2)).to_be_false()
예제 #4
0
    def test_validate_enforces_strings(self):
        field = StringField(max_length=5)

        expect(field.validate(1)).to_be_false()
예제 #5
0
    def test_validate_enforces_strings(self):
        field = StringField(max_length=5)

        expect(field.validate(1)).to_be_false()