@contextmanager
def capture_reset_password_requests(reset_password_sent_at=None):
 reset_requests = []
 def _on(app, **data):
  reset_requests.append(data)
 reset_password_instructions_sent.connect(_on)
 try:
  (yield reset_requests)
 finally:
  reset_password_instructions_sent.disconnect(_on)

@ contextmanager def capture_reset_password_requests ( reset_password_sent_at = None ) : reset_requests = [ ] def _on ( app , ** data ) : reset_requests . append ( data ) reset_password_instructions_sent . connect ( _on ) try : ( yield reset_requests ) finally : reset_password_instructions_sent . disconnect ( _on )
testing utility for capturing password reset requests .