def test_it_raises_if_json_parsing_fails(self):
        request = self.mock_request()

        # Make accessing the request.json_body property raise ValueError.
        type(request).json_body = mock.PropertyMock(side_effect=ValueError)

        with pytest.raises(views.PayloadError):
            views.create(request)
It raises PayloadError if parsing of the request body fails.
dataset/ETHPy150Open hypothesis/h/h/api/test/views_test.py/TestCreateLegacy.test_it_raises_if_json_parsing_fails