Commit 3d2fa778 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Assert that a Fpasswd entity is created in ForgotTC::test_reset_password

Currently, this test fails on python3 because mails are not sent
(because of a bug in cubicweb.crypto pending fix [1]) though we at least
ensure that the Fpasswd entity is created.

[1]: https://lists.cubicweb.org/pipermail/cubicweb-devel/2019-May/002913.html
parent cd559ea6cc0a
......@@ -18,12 +18,18 @@ class ForgotTC(CubicWebTC):
cnx.commit()
def test_reset_password(self):
with self.admin_access.cnx() as cnx:
count = cnx.execute('Any COUNT(X) WHERE X is Fpasswd')[0][0]
assert count == 0
MAILBOX[:] = []
self.assertEqual(len(MAILBOX), 0)
self.config.global_set_option('base-url', 'http://babar.com/')
with self.repo.internal_cnx() as cnx:
cnx.call_service('forgotpwd_send_email', use_email=u'test_user1@logilab.fr')
cnx.commit()
with self.admin_access.cnx() as cnx:
count = cnx.execute('Any COUNT(X) WHERE X is Fpasswd')[0][0]
assert count == 1
self.assertEqual(len(MAILBOX), 1)
self.assertIn('http://babar.com', MAILBOX[0].content)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment