

def test_max_value_validation_fail(self):
    obj = ValidationMaxValueValidatorModel.objects.create(number_value=100)
    request = factory.patch('/{0}'.format(obj.pk), {
        'number_value': 101,
    }, format='json')
    view = UpdateMaxValueValidationModel().as_view()
    response = view(request, pk=obj.pk).render()
    request.assertEqual(response.content, b'{"number_value":["Ensure this value is less than or equal to 100."]}')
    self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)

dataset/ETHPy150Open tomchristie/django-rest-framework/tests/test_validation.py TestMaxValueValidatorValidation.test_max_value_validation_fail/VarMisuse@79/103 `self`->`request`