'Returns the integer status code from the response, which
can be either a Webob.Response (used in testing) or httplib.Response'

def get_status_code(self, response):

    if hasattr(response, 'status_int'):
        return response.status_int
    return response.status
