Permalink
Browse files

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

…s fail.
  • Loading branch information...
1 parent 8abfe3e commit 9f3945e9bf59c31004a03716510f2918a50c8683 @brosner committed Nov 29, 2009
Showing with 7 additions and 2 deletions.
  1. +7 −2 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('.')

0 comments on commit 9f3945e

Please sign in to comment.