diff options
author | David Gouldin <david@gould.in> | 2012-05-12 15:20:14 -0700 |
---|---|---|
committer | David Gouldin <david@gould.in> | 2012-05-12 15:20:14 -0700 |
commit | bbee30c35e5eb438567e693f6df00644ad3bc4fb (patch) | |
tree | 644edf917cf21123adc4cde9a864ee0b8bf47583 /tests/oauth1/rfc5849/test_parameters.py | |
parent | a56cf9c1721e81abb02b8578493cb85bd3307e35 (diff) | |
download | oauthlib-use_request_objects.tar.gz |
Continuing to refactor oauth1 to use Request objects internally.use_request_objects
Diffstat (limited to 'tests/oauth1/rfc5849/test_parameters.py')
-rw-r--r-- | tests/oauth1/rfc5849/test_parameters.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/oauth1/rfc5849/test_parameters.py b/tests/oauth1/rfc5849/test_parameters.py index 9765cab..4388123 100644 --- a/tests/oauth1/rfc5849/test_parameters.py +++ b/tests/oauth1/rfc5849/test_parameters.py @@ -7,6 +7,10 @@ from ...unittest import TestCase class ParameterTests(TestCase): + data_params = [ + (u'data_param_foo', u'foo'), + (u'data_param_1', u'1'), + ] auth_only_params = [ (u'oauth_consumer_key', u"9djdj82h48djs9d2"), (u'oauth_token', u"kkk9d7dh3k39sjv7"), @@ -15,9 +19,7 @@ class ParameterTests(TestCase): (u'oauth_nonce', u"7d8f3e4a"), (u'oauth_signature', u"bYT5CMsGcbgUdFHObYMEfcx6bsw=") ] - auth_and_data = list(auth_only_params) - auth_and_data.append((u'data_param_foo', u'foo')) - auth_and_data.append((u'data_param_1', u'1')) + auth_and_data = auth_only_params + data_params realm = u'testrealm' norealm_authorization_header = u' '.join(( u'OAuth', @@ -72,11 +74,11 @@ class ParameterTests(TestCase): {u'Authorization': self.withrealm_authorization_header}) def test_prepare_form_encoded_body(self): - request = Request(u'http://www.google.com/') + request = Request(u'http://www.google.com/', body=self.data_params) request.oauth_params = self.auth_only_params - form_encoded_body = 'data_param_foo=foo&data_param_1=1&oauth_consumer_key=9djdj82h48djs9d2&oauth_token=kkk9d7dh3k39sjv7&oauth_signature_method=HMAC-SHA1&oauth_timestamp=137131201&oauth_nonce=7d8f3e4a&oauth_signature=bYT5CMsGcbgUdFHObYMEfcx6bsw%3D' + form_encoded_body = u'data_param_foo=foo&data_param_1=1&oauth_consumer_key=9djdj82h48djs9d2&oauth_token=kkk9d7dh3k39sjv7&oauth_signature_method=HMAC-SHA1&oauth_timestamp=137131201&oauth_nonce=7d8f3e4a&oauth_signature=bYT5CMsGcbgUdFHObYMEfcx6bsw%3D' self.assertEqual( - urlencode(prepare_form_encoded_body(self.auth_and_data, existing_body)), + urlencode(prepare_form_encoded_body(request).body), form_encoded_body) def test_prepare_request_uri_query(self): |