Some more polish. Fix a test

This commit is contained in:
Matt Wright
2012-05-15 17:17:38 -04:00
parent 903b07bfbb
commit 17ea120032
2 changed files with 5 additions and 4 deletions
+2 -3
View File
@@ -130,7 +130,7 @@ def confirm():
"""
try:
token = request.args.get('confirmation_token', None)
user = confirm_by_token(token)
confirm_by_token(token)
except ConfirmationError, e:
do_flash(str(e), 'error')
@@ -147,8 +147,7 @@ def confirm():
return redirect('/')
_do_login(user)
do_flash('Thank you! Your email has been confirmed', 'success')
do_flash('Your email has been confirmed. You may now log in.', 'success')
return redirect(security.post_confirm_view or security.post_login_view)
+3 -1
View File
@@ -174,8 +174,10 @@ class ConfirmationTests(SecurityTest):
self.register(e)
token = users[0].confirmation_token
r = self.authenticate('dude@lp.com', 'password')
self.assertIn('Account requires confirmation', r.data)
r = self.client.get('/confirm?confirmation_token=' + token, follow_redirects=True)
self.assertIn('Thank you! Your email has been confirmed', r.data)
self.assertIn('Your email has been confirmed. You may now log in.', r.data)
def test_invalid_or_unprovided_token_when_confirming_email(self):
r = self.client.get('/confirm', follow_redirects=True)