mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-28 16:20:24 +08:00
Fix password_changed signal to behave like the other signals. Fixes #222
This commit is contained in:
@@ -42,4 +42,4 @@ def change_user_password(user, password):
|
||||
user.password = encrypt_password(password)
|
||||
_datastore.put(user)
|
||||
send_password_changed_notice(user)
|
||||
password_changed.send(user, app=app._get_current_object())
|
||||
password_changed.send(app._get_current_object(), user=user)
|
||||
|
||||
@@ -179,8 +179,8 @@ class ChangeableSignalsTests(SignalTest):
|
||||
calls = mocks[password_changed]
|
||||
self.assertEqual(len(calls), 1)
|
||||
args, kwargs = calls[0]
|
||||
self.assertTrue(compare_user(args[0], user))
|
||||
self.assertEqual(kwargs['app'], self.app)
|
||||
self.assertTrue(compare_user(kwargs['user'], user))
|
||||
self.assertEqual(args[0], self.app)
|
||||
|
||||
def test_change_password_invalid_password(self):
|
||||
with capture_signals() as mocks:
|
||||
|
||||
Reference in New Issue
Block a user