mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-27 16:10:11 +08:00
polish
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
import base64
|
||||
@@ -5,10 +7,10 @@ import time
|
||||
import simplejson as json
|
||||
|
||||
from flask.ext.security.utils import capture_registrations, \
|
||||
capture_reset_password_requests, capture_passwordless_login_requests
|
||||
capture_reset_password_requests, capture_passwordless_login_requests
|
||||
from flask.ext.security.forms import LoginForm, ConfirmRegisterForm, RegisterForm, \
|
||||
ForgotPasswordForm, ResetPasswordForm, SendConfirmationForm, \
|
||||
PasswordlessLoginForm
|
||||
ForgotPasswordForm, ResetPasswordForm, SendConfirmationForm, \
|
||||
PasswordlessLoginForm
|
||||
from flask.ext.security.forms import TextField, SubmitField, valid_user_email
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
from flask_security.utils import (capture_registrations, capture_reset_password_requests, capture_signals)
|
||||
from flask_security.signals import (user_registered, user_confirmed,
|
||||
confirm_instructions_sent, login_instructions_sent,
|
||||
password_reset, password_changed,
|
||||
reset_password_instructions_sent)
|
||||
from flask_security.utils import capture_registrations, \
|
||||
capture_reset_password_requests, capture_signals
|
||||
from flask_security.signals import user_registered, user_confirmed, \
|
||||
confirm_instructions_sent, login_instructions_sent, \
|
||||
password_reset, password_changed, reset_password_instructions_sent
|
||||
from tests import SecurityTest
|
||||
|
||||
|
||||
@@ -64,9 +66,8 @@ class ConfirmableSignalsTests(SecurityTest):
|
||||
|
||||
def test_confirm_bad_token(self):
|
||||
e = 'dude@lp.com'
|
||||
with capture_registrations() as registrations:
|
||||
with capture_registrations():
|
||||
self.register(e)
|
||||
token = registrations[0]['confirm_token']
|
||||
with capture_signals() as mocks:
|
||||
self.client.get('/confirm/bogus', follow_redirects=True)
|
||||
self.assertEqual(mocks.signals_sent(), set())
|
||||
|
||||
Reference in New Issue
Block a user