Make confirm endpoint anonymous only and get rid of invalid test

This commit is contained in:
Matt Wright
2012-08-23 15:03:13 -04:00
parent 57595bbab4
commit 5a4fb94be3
2 changed files with 1 additions and 14 deletions
+1
View File
@@ -170,6 +170,7 @@ def send_confirmation():
**_ctx('send_confirmation'))
@anonymous_user_required
def confirm_email(token):
"""View function which handles a email confirmation request."""
after_this_request(_commit)
-14
View File
@@ -317,20 +317,6 @@ class ConfirmableTests(SecurityTest):
msg = self.app.config['SECURITY_MSG_EMAIL_CONFIRMED'][0]
self.assertIn(msg, r.data)
def test_confirm_email_twice_flashes_already_confirmed_message(self):
e = 'dude@lp.com'
with capture_registrations() as registrations:
self.register(e)
token = registrations[0]['confirm_token']
url = '/confirm/' + token
self.client.get(url, follow_redirects=True)
r = self.client.get(url, follow_redirects=True)
msg = self.app.config['SECURITY_MSG_ALREADY_CONFIRMED'][0]
self.assertIn(msg, r.data)
def test_invalid_token_when_confirming_email(self):
r = self.client.get('/confirm/bogus', follow_redirects=True)
self.assertIn('Invalid confirmation token', r.data)