def test_creating_person_from_factory_using_paramters(self):
        from model_mommy.mommy import Mommy
        from model_mommy.models import Person

        person_mom = Mommy(Person)
        person = person_mom.make_one(happy=False, age=20, gender='M', name='John')
        self.assertEqual(person.age, 20)
        self.assertEqual(person.happy, False)
        self.assertEqual(person.name, 'John')
        self.assertEqual(person.gender, 'M')
Beispiel #2
0
def exist_a_project(step):
    for project_hashes in step.hashes:
        mom = Mommy(Project, False)
        project = mom.make_one(name=project_hashes.get('name'))
Beispiel #3
0
def exist_a_news(step):
    for news_hashes in step.hashes:
        mom = Mommy(News, False)
        news = mom.make_one(title=news_hashes.get('title'), summary=news_hashes.get('summary'))
Beispiel #4
0
def exist_a_tool(step):
    for tool_hashes in step.hashes:
        mom = Mommy(Tool, False)
        tool = mom.make_one(name=tool_hashes.get('name'), highlight=tool_hashes.get('highlight'))
Beispiel #5
0
def exist_a_project(step):
    for project_hashes in step.hashes:
        mom = Mommy(Project, False)
        project = mom.make_one(name=project_hashes.get('name'), status=project_hashes.get('status'))
Beispiel #6
0
def exist_a_news(step):
    for news_hashes in step.hashes:
        mom = Mommy(News, False)
        news = mom.make_one(title=news_hashes.get('title'),
                            summary=news_hashes.get('summary'))
Beispiel #7
0
def exist_a_tool(step):
    for tool_hashes in step.hashes:
        mom = Mommy(Tool, False)
        tool = mom.make_one(name=tool_hashes.get('name'),
                            highlight=tool_hashes.get('highlight'))