Unit test for check_user_auth auxiliary function