示例#1
0
 def test_simple_generate_create(self):
     obj = factory.simple_generate(FakeDjangoModel, True, foo='bar')
     self.assertEqual(obj.id, 1)
     self.assertEqual(obj.foo, 'bar')
示例#2
0
 def test_simple_generate_build(self):
     obj = factory.simple_generate(FakeDjangoModel, False, foo='bar')
     self.assertEqual(obj.id, None)
     self.assertEqual(obj.foo, 'bar')
示例#3
0
 def test_simple_generate_build(self):
     obj = factory.simple_generate(FakeModel, False, foo='bar')
     self.assertEqual(obj.id, None)
     self.assertEqual(obj.foo, 'bar')
示例#4
0
 def test_simple_generate_create(self):
     obj = factory.simple_generate(FakeModel, True, foo='bar')
     self.assertEqual(obj.id, 2)
     self.assertEqual(obj.foo, 'bar')
示例#5
0
 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')