forked from Scifabric/pybossa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Hello {{ user.fullname }}, | ||
|
||
We received a request to recover your password for {{ config.BRAND }}. | ||
|
||
If you did not request this, please ignore this email. | ||
|
||
To recover your password, please visit the URL below: | ||
|
||
[Click here to recover your account][recover] | ||
|
||
[recover]: {{ recovery_url }} | ||
|
||
Regards, | ||
|
||
{{ config.BRAND }} Team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Hello {{ user.fullname }}, | ||
|
||
We received a request to recover your password for {{ config.BRAND }}. | ||
|
||
If you did not request this, please ignore this email. | ||
|
||
Our records show that you use your {{ account_name }} account to sign in. Please use | ||
the same account to sign-in again. If you forgot the password to your {{ account_name }} | ||
account, please contact {{ acount_name }}. | ||
|
||
Regards, | ||
{{ config.BRAND }} Team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ Flask-WTF==0.6 | |
Flask-Gravatar | ||
Flask-OAuth | ||
Flask-SQLAlchemy | ||
Flask-Mail | ||
dateutils | ||
alembic | ||
psycopg2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import json | ||
|
||
from base import web, model, Fixtures | ||
from base import web, model, Fixtures, mail | ||
from mock import patch | ||
from itsdangerous import BadSignature | ||
from collections import namedtuple | ||
from flask import g | ||
from pybossa.core import db, signer | ||
|
||
|
||
|
@@ -1277,12 +1276,18 @@ def side_effects(*args, **kwargs): | |
def test_45_password_reset_link(self): | ||
"""Test WEB password reset email form""" | ||
res = self.app.post('/account/forgot-password', data={ | ||
'email': '[email protected]' | ||
'email_addr': '[email protected]' | ||
}, follow_redirects=True) | ||
assert "This email doesn't seem to be associated with an account" in res.data | ||
assert ("We don't have this email in our records. You may have" | ||
" signed up with a different email or used Twitter, " | ||
"Facebook, or Google to sign-in") in res.data | ||
|
||
self.register() | ||
res = self.app.post('/account/forgot-password', data={ | ||
'email': '[email protected]' | ||
# TODO: This is a hack to get tests working. Documented method to | ||
# supress mail sending doesn't seem to work | ||
mail.suppress = True | ||
with mail.record_messages() as outbox: | ||
self.app.post('/account/forgot-password', data={ | ||
'email_addr': '[email protected]' | ||
}, follow_redirects=True) | ||
assert g.outbox[0].subject == 'Password Recovery' | ||
assert outbox[0].subject == 'Account Recovery' |