Exemplo n.º 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')
Exemplo n.º 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")
Exemplo n.º 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')