# Path: tests/ex04_contact/models.py
# class Person(object):
#     name = related.StringField()
#     age = related.IntegerField(required=False)
#     address = related.ChildField(Address, required=False, repr=False)
#     education = related.SequenceField(Education, required=False, repr=False)
# 
# class Address(object):
#     street = related.StringField()
#     city = related.StringField()
#     zipcode = related.StringField()
#     street_two = related.StringField(required=False)
# 
# class Education(object):
#     school = related.StringField()
#     degree = related.ChildField(Degree, required=False)
#     field_of_study = related.StringField(required=False)
#     from_year = related.IntegerField(required=False)
#     to_year = related.IntegerField(required=False)
# 
# class Degree(Enum):
#     HIGH_SCHOOL = "High School"
#     ASSOCIATES = "Associate's"
#     BACHELORS = "Bachelor's"
#     MASTERS = "Master's"
#     PHD = "Ph.D"
#     JD = "J.D."
#     MD = "M.D."
#     DDS = "D.D.S."
#     PHARMD = "Pharm.D."


from .models import Person, Address, Education, Degree
from related import to_dict, to_yaml, from_yaml
import pytest
    assert to_dict(new_person) == d
    assert new_person == person


def test_enum():
    education = Education(school="My Alma Mater", degree=Degree.MASTERS)

    # to_dict() => convert model to dictionary
    d = to_dict(education)
    assert d == {'school': 'My Alma Mater',
                 'degree': Degree.MASTERS.value,
                 'field_of_study': None,
                 'from_year': None,
                 'to_year': None}

    # now load from dictionary...
    new_education = Education(**d)
    assert to_dict(new_education) == d
    assert new_education == education

    d = to_dict(new_education)
    assert d == {'school': 'My Alma Mater',
                 'degree': Degree.MASTERS.value,
                 'field_of_study': None,
                 'from_year': None,
                 'to_year': None}


def test_person_with_education_sequence():
    person = Person(name="Brainy", education=[

# Path: tests/ex04_contact/models.py
# class Person(object):
#     name = related.StringField()
#     age = related.IntegerField(required=False)
#     address = related.ChildField(Address, required=False, repr=False)
#     education = related.SequenceField(Education, required=False, repr=False)
# 
# class Address(object):
#     street = related.StringField()
#     city = related.StringField()
#     zipcode = related.StringField()
#     street_two = related.StringField(required=False)
# 
# class Education(object):
#     school = related.StringField()
#     degree = related.ChildField(Degree, required=False)
#     field_of_study = related.StringField(required=False)
#     from_year = related.IntegerField(required=False)
#     to_year = related.IntegerField(required=False)
# 
# class Degree(Enum):
#     HIGH_SCHOOL = "High School"
#     ASSOCIATES = "Associate's"
#     BACHELORS = "Bachelor's"
#     MASTERS = "Master's"
#     PHD = "Ph.D"
#     JD = "J.D."
#     MD = "M.D."
#     DDS = "D.D.S."
#     PHARMD = "Pharm.D."


# Path: tests/ex04_contact/test_contact.py
from .models import Person, Address, Education, Degree
from related import to_dict, to_yaml, from_yaml
import pytest

    assert to_dict(new_person) == d
    assert new_person == person


def test_enum():
    education = Education(school="My Alma Mater", degree=Degree.MASTERS)

    # to_dict() => convert model to dictionary
    d = to_dict(education)
    assert d == {'school': 'My Alma Mater',
                 'degree': Degree.MASTERS.value,
                 'field_of_study': None,
                 'from_year': None,
                 'to_year': None}

    # now load from dictionary...
    new_education = Education(**d)
    assert to_dict(new_education) == d
    assert new_education == education

    d = to_dict(new_education)
    assert d == {'school': 'My Alma Mater',
                 'degree': Degree.MASTERS.value,
                 'field_of_study': None,
                 'from_year': None,
                 'to_year': None}


def test_person_with_education_sequence():
    person = Person(name="Brainy", education=[

        Education(school="School 2", degree=Degree.MASTERS),