Helper method to simulate login on tests