def test_given_interstitial_page_when_get_page_title_then_group_title_and_survey_title(
            self):
        # Given
        schema = load_schema_from_params('test', 'interstitial_page')

        # When
        page_title = get_page_title_for_location(
            schema, Location('favourite-foods', 0, 'breakfast-interstitial'),
            {}, AnswerStore())

        # Then
        self.assertEqual(page_title, 'Favourite food - Interstitial Pages')
    def test_given_introduction_page_when_get_page_title_then_defaults_to_survey_title(
            self):
        # Given
        schema = load_schema_from_params('test', 'final_confirmation')

        # When
        page_title = get_page_title_for_location(
            schema, Location('final-confirmation', 0, 'introduction'), {},
            AnswerStore())

        # Then
        self.assertEqual(page_title, 'Final confirmation to submit')
    def test_given_questionnaire_page_when_get_page_title_with_titles_object(
            self):

        # Given
        schema = load_schema_from_params('test', 'titles')

        # When
        page_title = get_page_title_for_location(
            schema, Location('group', 0, 'single-title-block'), {},
            AnswerStore())

        # Then
        self.assertEqual(
            page_title, 'How are you feeling?? - Multiple Question Title Test')
    def test_given_jinja_variable_question_title_when_get_page_title_then_replace_with_ellipsis(
            self):
        # Given
        schema = load_schema_from_params('census', 'household')

        # When
        page_title = get_page_title_for_location(
            schema,
            Location('who-lives-here-relationship', 0,
                     'household-relationships'), {}, AnswerStore())

        # Then
        self.assertEqual(
            page_title,
            'How is … related to the people below? - 2017 Census Test')
    def test_given_questionnaire_page_when_get_page_title_then_question_title_and_survey_title(
            self):
        # Given
        schema = load_schema_from_params('test', 'final_confirmation')

        # When
        page_title = get_page_title_for_location(
            schema, Location('final-confirmation', 0, 'breakfast'), {},
            AnswerStore())

        # Then
        self.assertEqual(
            page_title,
            'What is your favourite breakfast food - Final confirmation to submit'
        )