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)
def test_to_python_returns_value_when_value_LargeObjectFile(self): field = LargeObjectField() obj_file = LargeObjectFile() self.assertEqual(obj_file, field.to_python(obj_file))
def test_to_python_returns_None_when_value_None(self): field = LargeObjectField() self.assertEqual(None, field.to_python(None))