    def test_not_allow_2fa_flow(self, auth, mock_task):
        '''
        Tests if the user denies being sent a Duo Push.
        '''
        auth.auth_status.return_value = securitybot.auth.auth.AUTH_STATES.NONE
        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'

        # Also test not advancing on no queued task
        test_user.step()
        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'

        test_user.positive_response('Dummy explanation.')
        test_user.step()
        assert str(test_user._fsm.state) == 'auth_permission_check'
        assert (test_user._last_message.answer is None and
                test_user._last_message.text == '')

        test_user.negative_response('Dummy explanation.')
        test_user.step()
        assert str(test_user._fsm.state) == 'task_finished'
        assert (test_user._last_message.answer is None and
                test_user._last_message.text == '')

        mock_task.stop()
Tests if the user denies being sent a Duo Push.
tests/user_test.py