From f47fce9365d714aa633a82308e9bb141193d5426 Mon Sep 17 00:00:00 2001 From: Jameson Date: Thu, 23 Jan 2014 00:20:56 +0000 Subject: [PATCH] add test to show TypeError can occur --- tests/configured_tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/configured_tests.py b/tests/configured_tests.py index 5f16191..0324ecf 100644 --- a/tests/configured_tests.py +++ b/tests/configured_tests.py @@ -425,6 +425,15 @@ class RecoverableTests(SecurityTest): m = self.get_message('INVALID_RESET_PASSWORD_TOKEN') self.assertIn(m.encode('utf-8'), r.data) + def test_reset_password_with_mangled_token(self): + t = "WyIxNjQ2MzYiLCIxMzQ1YzBlZmVhM2VhZjYwODgwMDhhZGU2YzU0MzZjMiJd.BZEw_Q.lQyo3npdPZtcJ_sNHVHP103syjM&url_id=fbb89a8328e58c181ea7d064c2987874bc54a23d" + r = self._post('/reset/' + t, data={ + 'password': 'newpassword', + 'password_confirm': 'newpassword' + }, follow_redirects=True) + + self.assertIn(self.get_message('INVALID_RESET_PASSWORD_TOKEN'), r.data) + class ExpiredResetPasswordTest(SecurityTest):