Created
September 16, 2014 16:59
-
-
Save jamilatta/54d97c0e89f77856fe63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import factory | |
from editorialmanager import models | |
from journalmanager.tests.modelfactories import IssueFactory | |
class EditorialBoardFactory(factory.Factory): | |
FACTORY_FOR = models.EditorialBoard | |
issue = factory.SubFactory(IssueFactory) | |
class RoleTypeFactory(factory.Factory): | |
FACTORY_FOR = models.RoleType | |
name = factory.Sequence(lambda n: "Role_%s" % n) | |
class EditorialMemberFactory(factory.Factory): | |
FACTORY_FOR = models.EditorialMember | |
role = factory.SubFactory(RoleTypeFactory) | |
board = factory.SubFactory(EditorialBoardFactory) | |
#Required fields | |
first_name = factory.Sequence(lambda n: "first_name_%s" % n) | |
last_name = factory.Sequence(lambda n: "last_name_%s" % n) | |
email = factory.Sequence(lambda n: "email%s@example.com" % n) | |
institution = factory.Sequence(lambda n: "institution_%s" % n) | |
link_cv = factory.Sequence(lambda n: "http://buscatextual.cnpq.br/?id_%s" % n) | |
city = factory.Sequence(lambda n: 'city_%s' % n) | |
state = factory.Sequence(lambda n: 'state_%s' % n) | |
country = factory.Sequence(lambda n: 'country_%s' % n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK