Esempio n. 1
0
    def test_items_marked_active_if_activelink_set(self):
        html_page = MagicMock()
        active_item = self.nav_list[1]['href']

        html.write_navbar(html_page,
                          self.brand_name,
                          self.nav_list,
                          activelink=active_item)

        for call in html_page.call_args_list:
            html_string = call[0]
            if active_item in html_string:
                assert 'class="active"' in html_string
Esempio n. 2
0
    def test_no_items_marked_active_if_activelink_not_set(self):
        html_page = MagicMock()

        html.write_navbar(html_page, self.brand_name, self.nav_list)
        for call in html_page.write.call_args_list:
            assert 'class="active"' not in call[0]