Skip to content

Commit

Permalink
fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelia committed Apr 22, 2015
1 parent 4e69083 commit 88db132
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
from urlparse import urlparse, parse_qs
from urllib import unquote


from pydiscourse import sso
from pydiscourse.exceptions import DiscourseError


class SSOTestCase(unittest.TestCase):
def setUp(self):
# values from https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045
Expand Down Expand Up @@ -69,9 +67,12 @@ def test_valid_redirect_url(self):
payload = unquote(payload)
payload = dict((p.split('=') for p in payload.split('&')))

decoded = base64.decodestring(payload)
qs = parse_qs(decoded)

self.assertEqual(payload, {
'username': self.username,
'nonce': self.nonce,
'nonce': qs['nonce'][0],
'external_id': self.external_id,
'name': self.name,
'email': self.email
Expand Down

0 comments on commit 88db132

Please sign in to comment.