# 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


from collections import namedtuple, OrderedDict
from marshmallow import Schema, fields, missing as missing_
from tests.base import User, ALL_FIELDS, central
import datetime as dt
import itertools
import decimal
import uuid
import ipaddress
import pytest
            (dt.datetime(2013, 11, 10, 1, 23, 45), "2013-11-10T01:23:45"),
            (
                dt.datetime(2013, 11, 10, 1, 23, 45, 123456, tzinfo=dt.timezone.utc),
                "2013-11-10T01:23:45.123456+00:00",
            ),
            (
                dt.datetime(2013, 11, 10, 1, 23, 45, tzinfo=dt.timezone.utc),
                "2013-11-10T01:23:45+00:00",
            ),
            (
                central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
                "2013-11-10T01:23:45-06:00",
            ),
        ],
    )
    def test_datetime_field_iso8601(self, fmt, value, expected):
        if fmt is None:
            # Test default is ISO
            field = fields.DateTime()
        else:
            field = fields.DateTime(format=fmt)
        assert field.serialize("d", {"d": value}) == expected

    def test_datetime_field_format(self, user):
        format = "%Y-%m-%d"
        field = fields.DateTime(format=format)
        assert field.serialize("created", user) == user.created.strftime(format)

    def test_string_field(self):
        field = fields.String()

# 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_serialization.py
from collections import namedtuple, OrderedDict
from marshmallow import Schema, fields, missing as missing_
from tests.base import User, ALL_FIELDS, central
import datetime as dt
import itertools
import decimal
import uuid
import ipaddress
import pytest

            (dt.datetime(2013, 11, 10, 1, 23, 45), "2013-11-10T01:23:45"),
            (
                dt.datetime(2013, 11, 10, 1, 23, 45, 123456, tzinfo=dt.timezone.utc),
                "2013-11-10T01:23:45.123456+00:00",
            ),
            (
                dt.datetime(2013, 11, 10, 1, 23, 45, tzinfo=dt.timezone.utc),
                "2013-11-10T01:23:45+00:00",
            ),
            (
                central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
                "2013-11-10T01:23:45-06:00",
            ),
        ],
    )
    def test_datetime_field_iso8601(self, fmt, value, expected):
        if fmt is None:
            # Test default is ISO
            field = fields.DateTime()
        else:
            field = fields.DateTime(format=fmt)
        assert field.serialize("d", {"d": value}) == expected

    def test_datetime_field_format(self, user):
        format = "%Y-%m-%d"
        field = fields.DateTime(format=format)
        assert field.serialize("created", user) == user.created.strftime(format)

    def test_string_field(self):
        field = fields.String()

        user = User(name=b"foo")