# Path: tests/base.py
# ALL_FIELDS = [
#     fields.String,
#     fields.Integer,
#     fields.Boolean,
#     fields.Float,
#     fields.Number,
#     fields.DateTime,
#     fields.Time,
#     fields.Date,
#     fields.TimeDelta,
#     fields.Dict,
#     fields.Url,
#     fields.Email,
#     fields.UUID,
#     fields.Decimal,
#     fields.IP,
#     fields.IPv4,
#     fields.IPv6,
#     fields.IPInterface,
#     fields.IPv4Interface,
#     fields.IPv6Interface,
# ]
#     SPECIES = "Homo sapiens"
# def assert_date_equal(d1, d2):
# def assert_time_equal(t1, t2):
#     def __init__(
#         self,
#         name,
#         age=0,
#         id_=None,
#         homepage=None,
#         email=None,
#         registered=True,
#         time_registered=None,
#         birthdate=None,
#         birthtime=None,
#         balance=100,
#         sex="male",
#         employer=None,
#         various_data=None,
#     ):
#     def since_created(self):
#     def __repr__(self):
#     def __init__(self, title, user, collaborators=None, categories=None, id_=None):
#     def __contains__(self, item):
#     def __init__(self, foo):
#     def __eq__(self, other):
#     def __str__(self):
#     def _serialize(self, value, attr, obj):
# def get_lowername(obj):
#     def get_is_old(self, obj):
#     def make_user(self, data, **kwargs):
#     def get_is_old(self, obj):
#     def dumps(val):
#     def loads(val):
# class User:
# class Blog:
# class DummyModel:
# class Uppercased(fields.Field):
# class UserSchema(Schema):
#     class Meta:
# class UserMetaSchema(Schema):
#     class Meta:
# class UserExcludeSchema(UserSchema):
#     class Meta:
# class UserAdditionalSchema(Schema):
#     class Meta:
# class UserIntSchema(UserSchema):
# class UserFloatStringSchema(UserSchema):
# class ExtendedUserSchema(UserSchema):
# class UserRelativeUrlSchema(UserSchema):
# class BlogSchema(Schema):
# class BlogUserMetaSchema(Schema):
# class BlogSchemaMeta(Schema):
#     class Meta:
# class BlogOnlySchema(Schema):
# class BlogSchemaExclude(BlogSchema):
# class BlogSchemaOnlyExclude(BlogSchema):
# class mockjson:  # noqa


import datetime as dt
import uuid
import ipaddress
import decimal
import math
import pytest
from marshmallow import EXCLUDE, INCLUDE, RAISE, fields, Schema, validate
from marshmallow.exceptions import ValidationError
from marshmallow.validate import Equal
from tests.base import assert_date_equal, assert_time_equal, central, ALL_FIELDS
        errors = excinfo.value.messages
        assert "Something went wrong" in errors["foo"]

    def test_multiple_errors_can_be_stored_for_a_field(self):
        def validate_with_bool(n):
            return False

        def validate_with_error(n):
            raise ValidationError("foo is not valid")

        class MySchema(Schema):
            foo = fields.Field(
                required=True, validate=[validate_with_bool, validate_with_error]
            )

        with pytest.raises(ValidationError) as excinfo:
            MySchema().load({"foo": "bar"})
        errors = excinfo.value.messages

        assert type(errors["foo"]) == list
        assert len(errors["foo"]) == 2

    def test_multiple_errors_can_be_stored_for_an_email_field(self):
        def validate_with_bool(val):
            return False

        class MySchema(Schema):
            email = fields.Email(validate=[validate_with_bool])

        with pytest.raises(ValidationError) as excinfo:

# Path: tests/base.py
# ALL_FIELDS = [
#     fields.String,
#     fields.Integer,
#     fields.Boolean,
#     fields.Float,
#     fields.Number,
#     fields.DateTime,
#     fields.Time,
#     fields.Date,
#     fields.TimeDelta,
#     fields.Dict,
#     fields.Url,
#     fields.Email,
#     fields.UUID,
#     fields.Decimal,
#     fields.IP,
#     fields.IPv4,
#     fields.IPv6,
#     fields.IPInterface,
#     fields.IPv4Interface,
#     fields.IPv6Interface,
# ]
#     SPECIES = "Homo sapiens"
# def assert_date_equal(d1, d2):
# def assert_time_equal(t1, t2):
#     def __init__(
#         self,
#         name,
#         age=0,
#         id_=None,
#         homepage=None,
#         email=None,
#         registered=True,
#         time_registered=None,
#         birthdate=None,
#         birthtime=None,
#         balance=100,
#         sex="male",
#         employer=None,
#         various_data=None,
#     ):
#     def since_created(self):
#     def __repr__(self):
#     def __init__(self, title, user, collaborators=None, categories=None, id_=None):
#     def __contains__(self, item):
#     def __init__(self, foo):
#     def __eq__(self, other):
#     def __str__(self):
#     def _serialize(self, value, attr, obj):
# def get_lowername(obj):
#     def get_is_old(self, obj):
#     def make_user(self, data, **kwargs):
#     def get_is_old(self, obj):
#     def dumps(val):
#     def loads(val):
# class User:
# class Blog:
# class DummyModel:
# class Uppercased(fields.Field):
# class UserSchema(Schema):
#     class Meta:
# class UserMetaSchema(Schema):
#     class Meta:
# class UserExcludeSchema(UserSchema):
#     class Meta:
# class UserAdditionalSchema(Schema):
#     class Meta:
# class UserIntSchema(UserSchema):
# class UserFloatStringSchema(UserSchema):
# class ExtendedUserSchema(UserSchema):
# class UserRelativeUrlSchema(UserSchema):
# class BlogSchema(Schema):
# class BlogUserMetaSchema(Schema):
# class BlogSchemaMeta(Schema):
#     class Meta:
# class BlogOnlySchema(Schema):
# class BlogSchemaExclude(BlogSchema):
# class BlogSchemaOnlyExclude(BlogSchema):
# class mockjson:  # noqa


# Path: tests/test_deserialization.py
import datetime as dt
import uuid
import ipaddress
import decimal
import math
import pytest
from marshmallow import EXCLUDE, INCLUDE, RAISE, fields, Schema, validate
from marshmallow.exceptions import ValidationError
from marshmallow.validate import Equal
from tests.base import assert_date_equal, assert_time_equal, central, ALL_FIELDS

        errors = excinfo.value.messages
        assert "Something went wrong" in errors["foo"]

    def test_multiple_errors_can_be_stored_for_a_field(self):
        def validate_with_bool(n):
            return False

        def validate_with_error(n):
            raise ValidationError("foo is not valid")

        class MySchema(Schema):
            foo = fields.Field(
                required=True, validate=[validate_with_bool, validate_with_error]
            )

        with pytest.raises(ValidationError) as excinfo:
            MySchema().load({"foo": "bar"})
        errors = excinfo.value.messages

        assert type(errors["foo"]) == list
        assert len(errors["foo"]) == 2

    def test_multiple_errors_can_be_stored_for_an_email_field(self):
        def validate_with_bool(val):
            return False

        class MySchema(Schema):
            email = fields.Email(validate=[validate_with_bool])

        with pytest.raises(ValidationError) as excinfo:

            MySchema().load({"email": "foo"})