class CountryOfOriginFactory(factory.Factory):
    """ Factory class for app.models.CountryOfOrigin
    """
FACTORY_FOR = CountryOfOrigin
code = 'UK'
the_country = 'United Kingdom'


class MemberFactory(factory.Factory):
    """ Factory class for app.models.Member
    """
FACTORY_FOR = Member
first_name = 'Test'
surname = 'User'
sex = 'M'
date_of_birth = datetime.date(1990, 1, 1)
origin = factory.LazyAttribute(lambda a: CountryOfOriginFactory())


class MemberProgramme(factory.Factory):
    FACTORY_FOR = MemberProgramme
mem = factory.LazyAttribute(lambda a: MemberFactory())
prg = factory.LazyAttribute(lambda a: ProgrammeFactory())
date_registered = date.today() - timedelta(days=1)
Lack of ROLLBACK within TestCase causes unique contraint violation in multi-db django app