예제 #1
0
 def test_overwrite_attributes(self):
     class GF(Factory):
         name = generators.StaticGenerator('bar')
     class M(SimpleMockup):
         factory = GF
     mockups.register(SimpleModel, M)
     for obj in mockups.create(SimpleModel, 10):
         self.assertEqual(obj.name, 'bar')
     obj = mockups.create_one(SimpleModel)
     self.assertEqual(obj.name, 'bar')
예제 #2
0
 def test_create(self):
     mockups.register(SimpleModel, SimpleMockup)
     for obj in mockups.create(SimpleModel, 10):
         self.assertEqual(obj.name, "foo")
     obj = mockups.create_one(SimpleModel)
     self.assertEqual(obj.name, "foo")
예제 #3
0
 def test_create(self):
     mockups.register(SimpleModel, SimpleMockup)
     for obj in mockups.create(SimpleModel, 10):
         self.assertEqual(obj.name, 'foo')
     obj = mockups.create_one(SimpleModel)
     self.assertEqual(obj.name, 'foo')