Ejemplo n.º 1
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)
Ejemplo n.º 2
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)
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
 def test_summary_sibling_finder_returns_none_if_no_summary_page_exists(
         self):
     country_finder = PageFactory.create_country_finder_page(
         title='Country Finder')
     output = summary_sibling_finder(country_finder)
     self.assertIsNone(output)
Ejemplo n.º 5
0
 def next_page(self):
     return summary_sibling_finder(self)