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')
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")
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')