

def test_validation_error_with_non_file(self):
    '\n        Passing non-base64 should raise a validation error.\n        '
    now = datetime.datetime.now()
    errmsg = 'Please upload a valid image.'
    serializer = UploadedBase64ImageSerializer(data={
        'created': now,
        'file': 'abc',
    })
    self.assertFalse(serializer.is_valid())
    self.assertEqual(serializer.errors, {
        'file': [errmsg],
    })

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