def test_MAASAPIException_produces_http_response(self): error = factory.getRandomString() exception = MAASAPIBadRequest(error) response = exception.make_http_response() self.assertEqual( (httplib.BAD_REQUEST, error), (response.status_code, response.content))
def test_MAASAPIException_produces_http_response(self): error = factory.make_string() exception = MAASAPIBadRequest(error) response = exception.make_http_response() self.assertEqual( (http.client.BAD_REQUEST, error), (response.status_code, response.content.decode(settings.DEFAULT_CHARSET)))
def test_MAASAPIException_produces_http_response(self): error = factory.getRandomString() exception = MAASAPIBadRequest(error) response = exception.make_http_response() self.assertEqual((httplib.BAD_REQUEST, error), (response.status_code, response.content))