Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.

Commit f9dc71d

Browse files
author
Grace Yim
committed
Use self.request_token instead of ToopherIframeTest.request_token
1 parent f2f75fc commit f9dc71d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

test/test_toopher_iframe.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,21 +197,21 @@ def test_is_authentication_granted_is_false_with_auth_request_not_granted(self):
197197
data = self._get_auth_request_postback_data_as_dict()
198198
data['granted'] = 'false'
199199
data['toopher_sig'] = 'nADNKdly9zA2IpczD6gvDumM48I='
200-
authentication_granted = self.iframe_api.is_authentication_granted(self._get_urlencoded_auth_request_postback_data(data), ToopherIframeTests.request_token)
200+
authentication_granted = self.iframe_api.is_authentication_granted(self._get_urlencoded_auth_request_postback_data(data), self.request_token)
201201
self.assertFalse(authentication_granted, 'Postback should not have been granted with AuthenticationRequest not granted')
202202

203203
def test_is_authentication_granted_returns_false_when_pairing_is_returned(self):
204-
authentication_granted = self.iframe_api.is_authentication_granted(self._get_urlencoded_pairing_postback_data(), ToopherIframeTests.request_token)
204+
authentication_granted = self.iframe_api.is_authentication_granted(self._get_urlencoded_pairing_postback_data(), self.request_token)
205205
self.assertFalse(authentication_granted)
206206

207207
def test_is_authentication_granted_returns_false_when_user_is_returned(self):
208-
authentication_granted = self.iframe_api.is_authentication_granted(self._get_urlencoded_user_postback_data(), ToopherIframeTests.request_token)
208+
authentication_granted = self.iframe_api.is_authentication_granted(self._get_urlencoded_user_postback_data(), self.request_token)
209209
self.assertFalse(authentication_granted)
210210

211211
def test_is_authentication_granted_returns_false_when_missing_keys(self):
212212
data = self._get_auth_request_postback_data_as_dict()
213213
del data['id']
214-
authentication_granted = self.iframe_api.is_authentication_granted(self._get_urlencoded_auth_request_postback_data(data), ToopherIframeTests.request_token)
214+
authentication_granted = self.iframe_api.is_authentication_granted(self._get_urlencoded_auth_request_postback_data(data), self.request_token)
215215
self.assertFalse(authentication_granted)
216216

217217
def test_get_user_management_url(self):
@@ -229,11 +229,11 @@ def test_get_user_management_url_only_username(self):
229229

230230
def test_get_authentication_url(self):
231231
expected = 'https://api.toopher.test/v1/web/authenticate?username=jdoe&reset_email=jdoe%40example.com&session_token=s9s7vsb&expires=1300&action_name=Log+In&requester_metadata=None&v=2&oauth_nonce=12345678&oauth_timestamp=1000&oauth_version=1.0&oauth_signature_method=HMAC-SHA1&oauth_consumer_key=abcdefg&oauth_signature=YN%2BkKNTaoypsB37fsjvMS8vsG5A%3D'
232-
self.assertEqual(expected, self.iframe_api.get_authentication_url('jdoe', 'jdoe@example.com', ToopherIframeTests.request_token))
232+
self.assertEqual(expected, self.iframe_api.get_authentication_url('jdoe', 'jdoe@example.com', self.request_token))
233233

234234
def test_get_authentication_url_with_optional_args_and_extras(self):
235235
expected = 'https://api.toopher.test/v1/web/authenticate?username=jdoe&reset_email=jdoe%40example.com&session_token=s9s7vsb&allow_inline_pairing=False&expires=1100&action_name=it+is+a+test&automation_allowed=False&requester_metadata=metadata&v=2&challenge_required=True&oauth_nonce=12345678&oauth_timestamp=1000&oauth_version=1.0&oauth_signature_method=HMAC-SHA1&oauth_consumer_key=abcdefg&oauth_signature=hKogqI%2FgjKXpYIH%2BjNDhRSi22b4%3D'
236-
self.assertEqual(expected, self.iframe_api.get_authentication_url('jdoe', 'jdoe@example.com', ToopherIframeTests.request_token, 'it is a test', 'metadata', allow_inline_pairing=False, automation_allowed=False, challenge_required=True, ttl=100))
236+
self.assertEqual(expected, self.iframe_api.get_authentication_url('jdoe', 'jdoe@example.com', self.request_token, 'it is a test', 'metadata', allow_inline_pairing=False, automation_allowed=False, challenge_required=True, ttl=100))
237237

238238
def test_get_authentication_url_with_extras(self):
239239
expected = 'https://api.toopher.test/v1/web/authenticate?username=jdoe&reset_email=None&session_token=None&allow_inline_pairing=False&expires=1100&action_name=Log+In&automation_allowed=False&requester_metadata=None&v=2&challenge_required=True&oauth_nonce=12345678&oauth_timestamp=1000&oauth_version=1.0&oauth_signature_method=HMAC-SHA1&oauth_consumer_key=abcdefg&oauth_signature=zdE78ucexk2Y9T5NVRDsf9NvcOI%3D'

0 commit comments

Comments
 (0)