diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-05-21 18:34:23 +0200 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-05-21 18:34:23 +0200 |
commit | d5e035e9193cb9c9faff0e8601e2908bf5285f9c (patch) | |
tree | 7cdc675b8b8e504f5f0087dd5b275fa596685406 /mediagoblin/tests/test_edit.py | |
parent | 6c1467d570a4da68ef8b4edac9aecdb9c87a61de (diff) | |
parent | 2ba7603469a80ccfc1c07ddebc53ad6c6f0a6f79 (diff) | |
download | mediagoblin-d5e035e9193cb9c9faff0e8601e2908bf5285f9c.tar.lz mediagoblin-d5e035e9193cb9c9faff0e8601e2908bf5285f9c.tar.xz mediagoblin-d5e035e9193cb9c9faff0e8601e2908bf5285f9c.zip |
Merge remote-tracking branch 'rodney757/change_pass'
* rodney757/change_pass:
fixed translation, and changed tabs to spaces, and change it so the user can view their password as they're typing.
modified change_pass tests
moved change pass to a seperate view and fixed issues 709
Diffstat (limited to 'mediagoblin/tests/test_edit.py')
-rw-r--r-- | mediagoblin/tests/test_edit.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/mediagoblin/tests/test_edit.py b/mediagoblin/tests/test_edit.py index cda2607f..08b4f8cf 100644 --- a/mediagoblin/tests/test_edit.py +++ b/mediagoblin/tests/test_edit.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import urlparse import pytest from mediagoblin import mg_globals @@ -60,16 +61,17 @@ class TestUserEdit(object): self.login(test_app) # test that the password can be changed - # template.clear_test_template_context() + template.clear_test_template_context() res = test_app.post( - '/edit/account/', { + '/edit/password/', { 'old_password': 'toast', 'new_password': '123456', - 'wants_comment_notification': 'y' }) + res.follow() + + # Did we redirect to the correct page? + assert urlparse.urlsplit(res.location)[2] == '/edit/account/' - # Check for redirect on success - assert res.status_int == 302 # test_user has to be fetched again in order to have the current values test_user = User.query.filter_by(username=u'chris').first() assert bcrypt_check_password('123456', test_user.pw_hash) @@ -77,9 +79,10 @@ class TestUserEdit(object): self.user_password = '123456' # test that the password cannot be changed if the given - # old_password is wrong template.clear_test_template_context() + # old_password is wrong + template.clear_test_template_context() test_app.post( - '/edit/account/', { + '/edit/password/', { 'old_password': 'toast', 'new_password': '098765', }) |