# Path: tests/base.py
# class User:
#     SPECIES = "Homo sapiens"
# 
#     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,
#     ):
#         self.name = name
#         self.age = age
#         # A naive datetime
#         self.created = dt.datetime(2013, 11, 10, 14, 20, 58)
#         # A TZ-aware datetime
#         self.updated = central.localize(
#             dt.datetime(2013, 11, 10, 14, 20, 58), is_dst=False
#         )
#         self.id = id_
#         self.homepage = homepage
#         self.email = email
#         self.balance = balance
#         self.registered = True
#         self.hair_colors = ["black", "brown", "blond", "redhead"]
#         self.sex_choices = ("male", "female")
#         self.finger_count = 10
#         self.uid = uuid.uuid1()
#         self.time_registered = time_registered or dt.time(1, 23, 45, 6789)
#         self.birthdate = birthdate or dt.date(2013, 1, 23)
#         self.birthtime = birthtime or dt.time(0, 1, 2, 3333)
#         self.activation_date = dt.date(2013, 12, 11)
#         self.sex = sex
#         self.employer = employer
#         self.relatives = []
#         self.various_data = various_data or {
#             "pets": ["cat", "dog"],
#             "address": "1600 Pennsylvania Ave\n" "Washington, DC 20006",
#         }
# 
#     @property
#     def since_created(self):
#         return dt.datetime(2013, 11, 24) - self.created
# 
#     def __repr__(self):
#         return f"<User {self.name}>"
# 
# class UserSchema(Schema):
#     name = fields.String()
#     age = fields.Float()  # type: fields.Field
#     created = fields.DateTime()
#     created_formatted = fields.DateTime(
#         format="%Y-%m-%d", attribute="created", dump_only=True
#     )
#     created_iso = fields.DateTime(format="iso", attribute="created", dump_only=True)
#     updated = fields.DateTime()
#     species = fields.String(attribute="SPECIES")
#     id = fields.String(dump_default="no-id")
#     uppername = Uppercased(attribute="name", dump_only=True)
#     homepage = fields.Url()
#     email = fields.Email()
#     balance = fields.Decimal()
#     is_old = fields.Method("get_is_old")  # type: fields.Field
#     lowername = fields.Function(get_lowername)
#     registered = fields.Boolean()
#     hair_colors = fields.List(fields.Raw)
#     sex_choices = fields.List(fields.Raw)
#     finger_count = fields.Integer()
#     uid = fields.UUID()
#     time_registered = fields.Time()
#     birthdate = fields.Date()
#     birthtime = fields.Time()
#     activation_date = fields.Date()
#     since_created = fields.TimeDelta()
#     sex = fields.Str(validate=validate.OneOf(["male", "female"]))
#     various_data = fields.Dict()
# 
#     class Meta:
#         render_module = simplejson
# 
#     def get_is_old(self, obj):
#         if obj is None:
#             return missing
#         if isinstance(obj, dict):
#             age = obj.get("age")
#         else:
#             age = obj.age
#         try:
#             return age > 80
#         except TypeError as te:
#             raise ValidationError(str(te)) from te
# 
#     @post_load
#     def make_user(self, data, **kwargs):
#         return User(**data)
# 
# class Blog:
#     def __init__(self, title, user, collaborators=None, categories=None, id_=None):
#         self.title = title
#         self.user = user
#         self.collaborators = collaborators or []  # List/tuple of users
#         self.categories = categories
#         self.id = id_
# 
#     def __contains__(self, item):
#         return item.name in [each.name for each in self.collaborators]


import pytest
from tests.base import User, UserSchema, Blog
"""Pytest fixtures that are available in all test modules."""



@pytest.fixture
def user():
    return User(name="Monty", age=42.3, homepage="http://monty.python.org/")


@pytest.fixture
def blog(user):

# Path: tests/base.py
# class User:
#     SPECIES = "Homo sapiens"
# 
#     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,
#     ):
#         self.name = name
#         self.age = age
#         # A naive datetime
#         self.created = dt.datetime(2013, 11, 10, 14, 20, 58)
#         # A TZ-aware datetime
#         self.updated = central.localize(
#             dt.datetime(2013, 11, 10, 14, 20, 58), is_dst=False
#         )
#         self.id = id_
#         self.homepage = homepage
#         self.email = email
#         self.balance = balance
#         self.registered = True
#         self.hair_colors = ["black", "brown", "blond", "redhead"]
#         self.sex_choices = ("male", "female")
#         self.finger_count = 10
#         self.uid = uuid.uuid1()
#         self.time_registered = time_registered or dt.time(1, 23, 45, 6789)
#         self.birthdate = birthdate or dt.date(2013, 1, 23)
#         self.birthtime = birthtime or dt.time(0, 1, 2, 3333)
#         self.activation_date = dt.date(2013, 12, 11)
#         self.sex = sex
#         self.employer = employer
#         self.relatives = []
#         self.various_data = various_data or {
#             "pets": ["cat", "dog"],
#             "address": "1600 Pennsylvania Ave\n" "Washington, DC 20006",
#         }
# 
#     @property
#     def since_created(self):
#         return dt.datetime(2013, 11, 24) - self.created
# 
#     def __repr__(self):
#         return f"<User {self.name}>"
# 
# class UserSchema(Schema):
#     name = fields.String()
#     age = fields.Float()  # type: fields.Field
#     created = fields.DateTime()
#     created_formatted = fields.DateTime(
#         format="%Y-%m-%d", attribute="created", dump_only=True
#     )
#     created_iso = fields.DateTime(format="iso", attribute="created", dump_only=True)
#     updated = fields.DateTime()
#     species = fields.String(attribute="SPECIES")
#     id = fields.String(dump_default="no-id")
#     uppername = Uppercased(attribute="name", dump_only=True)
#     homepage = fields.Url()
#     email = fields.Email()
#     balance = fields.Decimal()
#     is_old = fields.Method("get_is_old")  # type: fields.Field
#     lowername = fields.Function(get_lowername)
#     registered = fields.Boolean()
#     hair_colors = fields.List(fields.Raw)
#     sex_choices = fields.List(fields.Raw)
#     finger_count = fields.Integer()
#     uid = fields.UUID()
#     time_registered = fields.Time()
#     birthdate = fields.Date()
#     birthtime = fields.Time()
#     activation_date = fields.Date()
#     since_created = fields.TimeDelta()
#     sex = fields.Str(validate=validate.OneOf(["male", "female"]))
#     various_data = fields.Dict()
# 
#     class Meta:
#         render_module = simplejson
# 
#     def get_is_old(self, obj):
#         if obj is None:
#             return missing
#         if isinstance(obj, dict):
#             age = obj.get("age")
#         else:
#             age = obj.age
#         try:
#             return age > 80
#         except TypeError as te:
#             raise ValidationError(str(te)) from te
# 
#     @post_load
#     def make_user(self, data, **kwargs):
#         return User(**data)
# 
# class Blog:
#     def __init__(self, title, user, collaborators=None, categories=None, id_=None):
#         self.title = title
#         self.user = user
#         self.collaborators = collaborators or []  # List/tuple of users
#         self.categories = categories
#         self.id = id_
# 
#     def __contains__(self, item):
#         return item.name in [each.name for each in self.collaborators]


# Path: tests/conftest.py
import pytest
from tests.base import User, UserSchema, Blog

"""Pytest fixtures that are available in all test modules."""



@pytest.fixture
def user():
    return User(name="Monty", age=42.3, homepage="http://monty.python.org/")


@pytest.fixture
def blog(user):

    col1 = User(name="Mick", age=123)