Tests for register_and_login method