Example #1
0
    def test_mode_of_study_sibling_finder_returns_mode_of_study_if_in_list(self):
        country_finder = PageFactory.create_country_finder_page(title='Country Finder')
        PageFactory.create_mode_of_study_finder_page(title='Mode of Study Finder', path='11111112',
                                                     parent_page=country_finder.get_parent())

        output = mode_of_study_sibling_finder(country_finder)
        self.assertIsNotNone(output)
        self.assertEquals(type(output), CourseFinderModeOfStudy)
Example #2
0
    def test_mode_of_study_sibling_finder_returns_mode_of_study_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())
        subject_chooser = PageFactory.create_choose_subject_page(title='Subject Chooser', path='11111113',
                                                                 parent_page=country_finder.get_parent())

        output = mode_of_study_sibling_finder(country_finder)
        self.assertIsNotNone(output)
        self.assertEquals(type(output), CourseFinderModeOfStudy)
        self.assertNotEquals(mode_of_study_finder.title, subject_chooser.title)
        self.assertEquals(output.title, mode_of_study_finder.title)
Example #3
0
 def test_mode_of_study_sibling_finder_returns_none_if_no_mode_of_study_page_exists(
         self):
     country_finder = PageFactory.create_country_finder_page(
         title='Country Finder')
     output = mode_of_study_sibling_finder(country_finder)
     self.assertIsNone(output)
 def back_page(self):
     return mode_of_study_sibling_finder(self)
 def next_page(self):
     return mode_of_study_sibling_finder(self)