if method_result:
            mock_test_method.return_value = method_result
        response = self.client.post(
            "/internal_api/v1/rpcapi",
            headers={"Content-Type": "application/json"},
            data=json.dumps(input_data),
        )
        assert response.status_code == expected_code
        if method_result:
            response_data = BaseSerialization.deserialize(json.loads(response.data))
            assert response_data == method_result
        if method_params:
            mock_test_method.assert_called_once_with(**method_params)
        else:
            mock_test_method.assert_called_once()
    def test_method_with_exception(self):