'Helper method for calling endpoint, verifying and returning response.
If expected_response_code is None, doesn\'t verify the response\' status_code.'

def api_response(self, reverse_args=None, expected_response_code=200, data=None, **kwargs):

    url = self.reverse_url(reverse_args, **kwargs)
    response = self.url_method(url, data=data, **kwargs)
    if (expected_response_code is not None):
        self.assertEqual(response.status_code, expected_response_code)
    return response
