mirror of
https://github.com/wassname/flask-security.git
synced 2026-09-09 11:22:35 +08:00
Views get forms from _security
This commit is contained in:
@@ -6,6 +6,10 @@ import simplejson as json
|
||||
|
||||
from flask.ext.security.utils import capture_registrations, \
|
||||
capture_reset_password_requests, capture_passwordless_login_requests
|
||||
from flask.ext.security.forms import LoginForm, ConfirmRegisterForm, RegisterForm, \
|
||||
ForgotPasswordForm, ResetPasswordForm, SendConfirmationForm, \
|
||||
PasswordlessLoginForm
|
||||
|
||||
|
||||
from tests import SecurityTest
|
||||
|
||||
@@ -488,13 +492,21 @@ class NoBlueprintTests(SecurityTest):
|
||||
|
||||
class ExtendFormsTest(SecurityTest):
|
||||
|
||||
class MyLoginForm(LoginForm):
|
||||
hidden_tag = 'not-so-secret'
|
||||
|
||||
APP_KWARGS = {
|
||||
'login_form': MyLoginForm,
|
||||
}
|
||||
|
||||
AUTH_CONFIG = {
|
||||
'SECURITY_REGISTERABLE': True,
|
||||
}
|
||||
|
||||
def test_login_view(self):
|
||||
r = self._get('/login')
|
||||
self.assertIn("<h1>Login</h1>", r.data)
|
||||
|
||||
def test_register(self):
|
||||
r = self._get('/register')
|
||||
self.assertIn('<h1>Register</h1>', r.data)
|
||||
|
||||
Reference in New Issue
Block a user