Rename test_webtests -> test_functional

master
Steven Loria 11 years ago
parent c156760f67
commit 757d152699
  1. 1
      {{cookiecutter.app_name}}/tests/test_forms.py
  2. 0
      {{cookiecutter.app_name}}/tests/test_functional.py
  3. 6
      {{cookiecutter.app_name}}/{{cookiecutter.app_name}}/public/forms.py

@ -59,4 +59,3 @@ class TestLoginForm:
form = LoginForm(username=user.username, password='example') form = LoginForm(username=user.username, password='example')
assert form.validate() is False assert form.validate() is False
assert 'User not activated' in form.username.errors assert 'User not activated' in form.username.errors

@ -19,14 +19,14 @@ class LoginForm(Form):
self.user = User.query.filter_by(username=self.username.data).first() self.user = User.query.filter_by(username=self.username.data).first()
if not self.user: if not self.user:
self.username.errors.append("Unknown username") self.username.errors.append('Unknown username')
return False return False
if not self.user.check_password(self.password.data): if not self.user.check_password(self.password.data):
self.password.errors.append("Invalid password") self.password.errors.append('Invalid password')
return False return False
if not self.user.active: if not self.user.active:
self.username.errors.append("User not activated") self.username.errors.append('User not activated')
return False return False
return True return True

Loading…
Cancel
Save