Add tests for loginCheck handler

- Devise a way to test the communication: now the last request is being stored
  if the application is in the test mode. Also, the messages are not being sent
  in that case.