

def test_remove_with_empty_string(self):
    '\n        Passing empty string as data should cause image to be removed\n        '
    now = datetime.datetime.now()
    file = 'R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='
    uploaded_image = UploadedBase64Image(file=file, created=now)
    serializer = UploadedBase64ImageSerializer(instance=uploaded_image, data={
        'created': now,
        'file': '',
    })
    self.assertTrue(serializer.is_valid())
    self.assertEqual(serializer.validated_data['created'], uploaded_image.created)
    self.assertIsNone(serializer.validated_data['file'])

dataset/ETHPy150Open Hipo/drf-extra-fields/tests/test_fields.py Base64ImageSerializerTests.test_remove_with_empty_string/original