Fix linting errors.

This commit is contained in:
Feanil Patel
2019-09-19 17:05:02 -04:00
parent 0c1e18ff53
commit 844acea50e
4 changed files with 18 additions and 6 deletions

View File

@@ -96,7 +96,11 @@ class GoogleOauth2IntegrationTest(base.Oauth2IntegrationTest):
})
# Check the hash that is used to confirm the user's data in the GET parameter is correct
secret_key = settings.THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS['custom1']['secret_key']
hmac_expected = hmac.new(secret_key.encode('utf-8'), msg=data_decoded.encode('utf-8'), digestmod=hashlib.sha256).digest()
hmac_expected = hmac.new(
secret_key.encode('utf-8'),
msg=data_decoded.encode('utf-8'),
digestmod=hashlib.sha256
).digest()
self.assertEqual(base64.b64decode(response.context['hmac']), hmac_expected)
# Now our custom registration form creates or logs in the user: