示例#1
0
 def test_to_python_returns_LargeObjectFile_when_value_long(self):
     oid = int(randint(1, 100))
     field = LargeObjectField()
     # South normally substitutes a FakeModel here, but with a baseline
     # schema, we can skip the migration that creates LargeObjectField.
     self.patch(field, "model")
     obj_file = field.to_python(oid)
     self.assertEqual(oid, obj_file.oid)
示例#2
0
 def test_to_python_returns_value_when_value_LargeObjectFile(self):
     field = LargeObjectField()
     obj_file = LargeObjectFile()
     self.assertEqual(obj_file, field.to_python(obj_file))
示例#3
0
 def test_to_python_returns_None_when_value_None(self):
     field = LargeObjectField()
     self.assertEqual(None, field.to_python(None))