Example #1
0
 def test_make_many_from_recipe(self):
     persons = mommy.make_many_from_recipe('test.generic.person')
     self.assertIsInstance(persons, list)
     self.assertEqual(len(persons), mommy.MAX_MANY_QUANTITY)
     for person in persons:
         self.assertIsInstance(person, Person)
         self.assertNotEqual(person.id, None)
Example #2
0
 def test_make_many_with_model_args(self):
     persons = mommy.make_many_from_recipe('model_mommy.person',
                                           name='Dennis Ritchie',
                                           age=70)
     for person in persons:
         self.assertEqual(person.name, 'Dennis Ritchie')
         self.assertEqual(person.age, 70)
Example #3
0
 def test_make_many_from_recipe(self):
     persons = mommy.make_many_from_recipe('model_mommy.person')
     self.assertIsInstance(persons, list)
     self.assertEqual(len(persons), mommy.MAX_MANY_QUANTITY)
     for person in persons:
         self.assertIsInstance(person, Person)
         self.assertNotEqual(person.id, None)
Example #4
0
 def test_make_many_with_model_args(self):
     """
     make_many_from_recipe is deprecated, so this test must be deleted when
     the method is
     """
     persons = mommy.make_many_from_recipe('test.generic.person', name='Dennis Ritchie', age=70)
     for person in persons:
         self.assertEqual(person.name, 'Dennis Ritchie')
         self.assertEqual(person.age, 70)
Example #5
0
 def test_make_many_from_recipe_with_specified_quantity(self):
     """
     make_many_from_recipe is deprecated, so this test must be deleted when
     the method is
     """
     quantity = 2
     persons = mommy.make_many_from_recipe('test.generic.person', quantity=quantity)
     self.assertIsInstance(persons, list)
     self.assertEqual(len(persons), quantity)
Example #6
0
 def test_make_many_with_model_args(self):
     """
     make_many_from_recipe is deprecated, so this test must be deleted when
     the method is
     """
     persons = mommy.make_many_from_recipe('test.generic.person', name='Dennis Ritchie', age=70)
     for person in persons:
         self.assertEqual(person.name, 'Dennis Ritchie')
         self.assertEqual(person.age, 70)
Example #7
0
 def test_make_many_from_recipe_with_specified_quantity(self):
     """
     make_many_from_recipe is deprecated, so this test must be deleted when
     the method is
     """
     quantity = 2
     persons = mommy.make_many_from_recipe('test.generic.person', quantity=quantity)
     self.assertIsInstance(persons, list)
     self.assertEqual(len(persons), quantity)
Example #8
0
 def test_make_many_from_recipe(self):
     """
     make_many_from_recipe is deprecated, so this test must be deleted when
     the method is
     """
     persons = mommy.make_many_from_recipe('test.generic.person')
     self.assertIsInstance(persons, list)
     self.assertEqual(len(persons), mommy.MAX_MANY_QUANTITY)
     for person in persons:
         self.assertIsInstance(person, Person)
         self.assertNotEqual(person.id, None)
Example #9
0
 def test_make_many_from_recipe(self):
     """
     make_many_from_recipe is deprecated, so this test must be deleted when
     the method is
     """
     persons = mommy.make_many_from_recipe('test.generic.person')
     self.assertIsInstance(persons, list)
     self.assertEqual(len(persons), mommy.MAX_MANY_QUANTITY)
     for person in persons:
         self.assertIsInstance(person, Person)
         self.assertNotEqual(person.id, None)
Example #10
0
 def test_make_many_with_model_args(self):
     persons = mommy.make_many_from_recipe('test.generic.person', name='Dennis Ritchie', age=70)
     for person in persons:
         self.assertEqual(person.name, 'Dennis Ritchie')
         self.assertEqual(person.age, 70)
Example #11
0
 def test_make_many_from_recipe_with_specified_quantity(self):
     quantity = 2
     persons = mommy.make_many_from_recipe('test.generic.person', quantity=quantity)
     self.assertIsInstance(persons, list)
     self.assertEqual(len(persons), quantity)
Example #12
0
 def test_make_many_from_recipe_with_specified_quantity(self):
     quantity = 2
     persons = mommy.make_many_from_recipe('model_mommy.person',
                                           quantity=quantity)
     self.assertIsInstance(persons, list)
     self.assertEqual(len(persons), quantity)