-
-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add validate.And * Rename _validate_callable to _validate_all * Test composing And * Add and_; fix passing a generator to And * Remove and_
- Loading branch information
1 parent
b58773a
commit a7054db
Showing
6 changed files
with
86 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -823,6 +823,11 @@ def test_email_field_deserialization(self): | |
field.deserialize("invalidemail") | ||
assert excinfo.value.args[0][0] == "Not a valid email address." | ||
|
||
field = fields.Email(validate=[validate.Length(min=12)]) | ||
with pytest.raises(ValidationError) as excinfo: | ||
field.deserialize("[email protected]") | ||
assert excinfo.value.args[0][0] == "Shorter than minimum length 12." | ||
|
||
# regression test for https://github.com/marshmallow-code/marshmallow/issues/1400 | ||
def test_email_field_non_list_validators(self): | ||
field = fields.Email(validate=(validate.Length(min=9),)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters