# 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,
# ]


import pytest
from marshmallow import (
    fields,
    Schema,
    ValidationError,
    EXCLUDE,
    INCLUDE,
    RAISE,
    missing,
)
from marshmallow.exceptions import StringNotCollectionError
from tests.base import ALL_FIELDS
            "Use 'dump_default' instead.",
        ):
            FieldClass(default=None)

        # via attribute
        myfield = FieldClass(dump_default=1)
        with pytest.warns(
            DeprecationWarning,
            match="The 'default' attribute of fields is deprecated. "
            "Use 'dump_default' instead.",
        ):
            assert myfield.default == 1
        with pytest.warns(
            DeprecationWarning,
            match="The 'default' attribute of fields is deprecated. "
            "Use 'dump_default' instead.",
        ):
            myfield.default = 0
        # but setting it worked
        assert myfield.dump_default == 0


class TestErrorMessages:
    class MyField(fields.Field):
        default_error_messages = {"custom": "Custom error message."}

    error_messages = [
        ("required", "Missing data for required field."),
        ("null", "Field may not be null."),
        ("custom", "Custom error message."),

# 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,
# ]


# Path: tests/test_fields.py
import pytest
from marshmallow import (
    fields,
    Schema,
    ValidationError,
    EXCLUDE,
    INCLUDE,
    RAISE,
    missing,
)
from marshmallow.exceptions import StringNotCollectionError
from tests.base import ALL_FIELDS

            "Use 'dump_default' instead.",
        ):
            FieldClass(default=None)

        # via attribute
        myfield = FieldClass(dump_default=1)
        with pytest.warns(
            DeprecationWarning,
            match="The 'default' attribute of fields is deprecated. "
            "Use 'dump_default' instead.",
        ):
            assert myfield.default == 1
        with pytest.warns(
            DeprecationWarning,
            match="The 'default' attribute of fields is deprecated. "
            "Use 'dump_default' instead.",
        ):
            myfield.default = 0
        # but setting it worked
        assert myfield.dump_default == 0


class TestErrorMessages:
    class MyField(fields.Field):
        default_error_messages = {"custom": "Custom error message."}

    error_messages = [
        ("required", "Missing data for required field."),
        ("null", "Field may not be null."),
        ("custom", "Custom error message."),

        ("validator_failed", "Invalid value."),