def test_simple_generate_create(self): obj = factory.simple_generate(FakeDjangoModel, True, foo='bar') self.assertEqual(obj.id, 1) self.assertEqual(obj.foo, 'bar')
def test_simple_generate_build(self): obj = factory.simple_generate(FakeDjangoModel, False, foo='bar') self.assertEqual(obj.id, None) self.assertEqual(obj.foo, 'bar')
def test_simple_generate_build(self): obj = factory.simple_generate(FakeModel, False, foo='bar') self.assertEqual(obj.id, None) self.assertEqual(obj.foo, 'bar')
def test_simple_generate_create(self): obj = factory.simple_generate(FakeModel, True, foo='bar') self.assertEqual(obj.id, 2) self.assertEqual(obj.foo, 'bar')
def test_simple_generate_create_custom_base(self): obj = factory.simple_generate(FakeModel, True, foo='bar', FACTORY_CLASS=factory.DjangoModelFactory) self.assertEqual(obj.id, 2) self.assertEqual(obj.foo, 'bar')