# 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
                dt.datetime(2013, 11, 9, 22, 23, 45),
            ),
        ],
    )
    def test_naive_datetime_with_timezone(self, fmt, timezone, value, expected):
        field = fields.NaiveDateTime(format=fmt, timezone=timezone)
        assert field.deserialize(value) == expected

    @pytest.mark.parametrize("timezone", (dt.timezone.utc, central))
    @pytest.mark.parametrize(
        ("fmt", "value"),
        [("iso", "2013-11-10T01:23:45"), ("rfc", "Sun, 10 Nov 2013 01:23:45")],
    )
    def test_aware_datetime_default_timezone(self, fmt, timezone, value):
        field = fields.AwareDateTime(format=fmt, default_timezone=timezone)
        assert field.deserialize(value) == dt.datetime(
            2013, 11, 10, 1, 23, 45, tzinfo=timezone
        )

    def test_time_field_deserialization(self):
        field = fields.Time()
        t = dt.time(1, 23, 45)
        t_formatted = t.isoformat()
        result = field.deserialize(t_formatted)
        assert isinstance(result, dt.time)
        assert_time_equal(result, t)
        # With microseconds
        t2 = dt.time(1, 23, 45, 6789)
        t2_formatted = t2.isoformat()
        result2 = field.deserialize(t2_formatted)

# 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

                dt.datetime(2013, 11, 9, 22, 23, 45),
            ),
        ],
    )
    def test_naive_datetime_with_timezone(self, fmt, timezone, value, expected):
        field = fields.NaiveDateTime(format=fmt, timezone=timezone)
        assert field.deserialize(value) == expected

    @pytest.mark.parametrize("timezone", (dt.timezone.utc, central))
    @pytest.mark.parametrize(
        ("fmt", "value"),
        [("iso", "2013-11-10T01:23:45"), ("rfc", "Sun, 10 Nov 2013 01:23:45")],
    )
    def test_aware_datetime_default_timezone(self, fmt, timezone, value):
        field = fields.AwareDateTime(format=fmt, default_timezone=timezone)
        assert field.deserialize(value) == dt.datetime(
            2013, 11, 10, 1, 23, 45, tzinfo=timezone
        )

    def test_time_field_deserialization(self):
        field = fields.Time()
        t = dt.time(1, 23, 45)
        t_formatted = t.isoformat()
        result = field.deserialize(t_formatted)
        assert isinstance(result, dt.time)
        assert_time_equal(result, t)
        # With microseconds
        t2 = dt.time(1, 23, 45, 6789)
        t2_formatted = t2.isoformat()
        result2 = field.deserialize(t2_formatted)

        assert_time_equal(result2, t2)