Beispiel #1
0
    def test_preference_result_when_store_preferences_is_not_completed_yet(
            self, render_template_mock, _):
        with Flask(__name__).app_context():
            store_preference_result.__wrapped__('some session id')

        render_template_mock.assert_called_with(
            'waiting-for-results.html',
            waiting_message='Saving your choice',
            routes=routes)
Beispiel #2
0
    def test_preference_result_when_store_preferences_is_failed(
            self, redirect_mock, _, session):
        session.get.return_value = 9999999999999999999999999999999999999999999

        with Flask(__name__).app_context():
            store_preference_result.__wrapped__('some session id')

        redirect_mock.assert_called_with('yourdetails.choice_not_saved')
        session.pop.assert_called()
    def test_preference_result_when_store_preferences_is_failed(self, redirect_mock, _, session):
        session.get.return_value = 9999999999999999999999999999999999999999999
        store_preference_result.__wrapped__('some session id')

        redirect_mock.assert_called_with(routes.get_absolute('yourdetails.choice_not_saved'))
        session.pop.assert_called()
Beispiel #4
0
    def test_preference_result_when_store_preferences_is_succeeded(
            self, redirect_mock, _):
        with Flask(__name__).app_context():
            store_preference_result.__wrapped__('some session id')

        redirect_mock.assert_called_with('yourdetails.thank_you')
    def test_preference_result_when_store_preferences_is_succeeded(self, redirect_mock, _):
        
        store_preference_result.__wrapped__('some session id')

        redirect_mock.assert_called_with(routes.get_absolute('yourdetails.thank_you'))