Example #1
0
    def test_choose_subject_sibling_finder_returns_choose_subject_if_in_list(self):
        country_finder = PageFactory.create_country_finder_page(title='Country Finder')
        PageFactory.create_choose_subject_page(title='Subject Chooser', path='11111112',
                                               parent_page=country_finder.get_parent())

        output = choose_subject_sibling_finder(country_finder)
        self.assertIsNotNone(output)
        self.assertEquals(type(output), CourseFinderChooseSubject)
Example #2
0
    def test_choose_subject_sibling_finder_returns_choose_subject_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 = choose_subject_sibling_finder(country_finder)
        self.assertIsNotNone(output)
        self.assertEquals(type(output), CourseFinderChooseSubject)
        self.assertNotEquals(mode_of_study_finder.title, subject_chooser.title)
        self.assertEquals(output.title, subject_chooser.title)
Example #3
0
 def test_choose_subject_sibling_finder_returns_none_if_no_choose_subject_page_exists(
         self):
     country_finder = PageFactory.create_country_finder_page(
         title='Country Finder')
     output = choose_subject_sibling_finder(country_finder)
     self.assertIsNone(output)
 def back_page(self):
     return choose_subject_sibling_finder(self)