def test_authentication_with_unauthenticated_user(self, create_user, switch_user):
        lti_user = self.create_lti_user_model()
        self.request.user = lti_user.edx_user
        self.request.user.is_authenticated = MagicMock(return_value=False)
        users.authenticate_lti_user(self.request, self.lti_user_id, self.lti_consumer)
        self.assertFalse(create_user.called)
        switch_user.assert_called_with(self.request, lti_user, self.lti_consumer)