

def test_serializer_errors_has_only_invalid_data_error(self):
    serializer = ValidationSerializer(data='invalid data')
    self.assertFalse(serializer.is_valid())
    self.assertDictEqual(serializer.errors, {
        'non_field_errors': [('Invalid data. Expected a dictionary, but got %s.' % type('').__name__)],
    })

dataset/ETHPy150Open tomchristie/django-rest-framework/tests/test_validation.py TestAvoidValidation.test_serializer_errors_has_only_invalid_data_error/original