    def test_auto_escalate(self, auth, mock_task):
        '''Tests that after some time an alert automatically escalates.'''
        auth.auth_status.return_value = securitybot.auth.auth.AUTH_STATES.DENIED
        auth.can_auth.return_value = True
        self.bot.messages = defaultdict(str)
        test_user = user.User({}, auth, self.bot)

        task = mock_task.start()

        assert str(test_user._fsm.state) == 'need_task'

        test_user.add_task(task)
        test_user.step()
        assert str(test_user._fsm.state) == 'action_performed_check'

        # Auto-escalation should happen immediately because escalation time
        # is set in the past


        test_user.step()
        assert str(test_user._fsm.state) == 'task_finished'
        task.set_verifying.assert_called_with()

        mock_task.stop()
Tests that after some time an alert automatically escalates.
tests/user_test.py