Esempio n. 1
0
    def test_course_finder_postcode_next_page_returns_summary_sibling(self):
        postcode = PageFactory.create_postcode_page(title='Postcode')
        PageFactory.create_summary_page(title='Summary',
                                        path='11111112',
                                        parent_page=postcode.get_parent())

        self.assertIsNotNone(postcode.next_page)
        self.assertEquals(type(postcode.next_page), CourseFinderSummary)
Esempio n. 2
0
    def test_course_finder_uni_next_page_returns_summary_sibling(self):
        uni = PageFactory.create_uni_page(title='Uni')
        PageFactory.create_summary_page(title='Summary',
                                        path='11111112',
                                        parent_page=uni.get_parent())

        self.assertIsNotNone(uni.next_page)
        self.assertEquals(type(uni.next_page), CourseFinderSummary)
Esempio n. 3
0
    def test_summary_sibling_finder_returns_summary_if_in_list(self):
        country_finder = PageFactory.create_country_finder_page(title='Country Finder')
        PageFactory.create_summary_page(title='Summary', path='11111112',
                                        parent_page=country_finder.get_parent())

        output = summary_sibling_finder(country_finder)
        self.assertIsNotNone(output)
        self.assertEquals(type(output), CourseFinderSummary)
Esempio n. 4
0
    def test_summary_sibling_finder_returns_first_entry_if_multiple_summary_in_list(self):
        country_finder = PageFactory.create_country_finder_page(title='Country Finder')
        summary_1 = PageFactory.create_summary_page(title='Summary', path='11111112',
                                                    parent_page=country_finder.get_parent())
        summary_2 = PageFactory.create_summary_page(title='Summary 2', path='11111113',
                                                    parent_page=country_finder.get_parent())

        output = summary_sibling_finder(country_finder)
        self.assertIsNotNone(output)
        self.assertEquals(type(output), CourseFinderSummary)
        self.assertNotEquals(summary_1.title, summary_2.title)
        self.assertEquals(output.title, summary_1.title)
Esempio n. 5
0
    def test_course_finder_summary_next_page_returns_results_sibling(self):
        summary = PageFactory.create_summary_page(title='Summary')
        PageFactory.create_results_page(title='Results',
                                        path='11111112',
                                        parent_page=summary.get_parent())

        self.assertIsNotNone(summary.next_page)
        self.assertEquals(type(summary.next_page), CourseFinderResults)
Esempio n. 6
0
    def test_course_finder_summary_back_page_returns_narrow_search_sibling(
            self):
        summary = PageFactory.create_summary_page(title='Summary')
        PageFactory.create_narrow_search_page(title='Postcode',
                                              path='11111112',
                                              parent_page=summary.get_parent())

        self.assertIsNotNone(summary.back_page)
        self.assertEquals(type(summary.back_page), CourseFinderNarrowSearch)
Esempio n. 7
0
    def test_summary_sibling_finder_returns_summary_if_multiple_page_types_exists(self):
        country_finder = PageFactory.create_country_finder_page(title='Country Finder')
        mode_of_study_finder = PageFactory.create_mode_of_study_finder_page(title='Mode of Study Finder',
                                                                            path='11111112',
                                                                            parent_page=country_finder.get_parent())
        summary = PageFactory.create_summary_page(title='Summary', path='11111113',
                                                  parent_page=country_finder.get_parent())

        output = summary_sibling_finder(country_finder)
        self.assertIsNotNone(output)
        self.assertEquals(type(output), CourseFinderSummary)
        self.assertNotEquals(mode_of_study_finder.title, summary.title)
        self.assertEquals(output.title, summary.title)