'Make sure WSGI header HTTP_AUTHORIZATION is detected correctly.'

def test_from_request_works_with_wsgi(self):

    url = 'http://sp.example.com/'
    params = {'oauth_version': '1.0', 'oauth_nonce': '4572616e48616d6d65724c61686176', 'oauth_timestamp': '137131200', 'oauth_consumer_key': '0685bd9184jfhq22', 'oauth_signature_method': 'HMAC-SHA1', 'oauth_token': 'ad180jjd733klru7', 'oauth_signature': 'wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D'}
    req = oauth.Request('GET', url, params)
    headers = req.to_header()
    headers['HTTP_AUTHORIZATION'] = headers['Authorization']
    del headers['Authorization']
    req = oauth.Request.from_request('GET', url, headers)
    self.assertEqual(req.method, 'GET')
    self.assertEqual(req.url, url)
    self.assertEqual(params, req.copy())
