code: def capture_registrations():
      
      registrations = []
  
      def _on(app, **data):
          registrations.append(data)
  
      user_registered.connect(_on)
  
      try:
          yield registrations
      finally:
          user_registered.disconnect(_on)
docs: Testing utility for capturing registrations.
  
      :param confirmation_sent_at: An optional datetime object to set the
                                   user's `confirmation_sent_at` to