Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

auth_tests was passing in full URIs into client.get which would alway…

…s fail.
  • Loading branch information...
commit 9f3945e9bf59c31004a03716510f2918a50c8683 1 parent 8abfe3e
@brosner authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 django_openid/tests/auth_tests.py
View
9 django_openid/tests/auth_tests.py
@@ -104,10 +104,12 @@ def testRegisterWithPassword(self):
# Now extract and click that link
msg = mail.outbox[0]
self.assertEqual(msg.to, [u'test@example.com'])
+ link_prefix = 'http://testserver'
link = [
l.strip() for l in msg.body.splitlines()
- if l.startswith('http://testserver/')
+ if l.startswith(link_prefix)
][0]
+ link = link.replace(link_prefix, '')
response = self.client.get(link)
self.assertEqual(
response.template_name, 'django_openid/register_complete.html'
@@ -142,10 +144,13 @@ def testRecoverAccountByUsername(self):
self.assertEqual(len(mail.outbox), 1)
msg = mail.outbox[0]
self.assertEqual(msg.to, [u'noopenids@example.com'])
+
+ link_prefix = 'http://testserver'
link = [
l.strip() for l in msg.body.splitlines()
- if l.startswith('http://testserver/')
+ if l.startswith(link_prefix)
][0]
+ link = link.replace(link_prefix, '')
# Tampering with the link should cause it to fail
bits = link.split('.')
Please sign in to comment.
Something went wrong with that request. Please try again.