Ejemplo n.º 1
0
    def test_delete_campaign_report_item(self):
        def handler(context, **kwarg):
            del (context['tabs_layout']['Other'])

        make_campaign_report.connect(handler)

        # test
        content = self.get()
        self.assertNotIn(
            '<a href="#other" aria-controls="other" '
            'role="tab" data-toggle="tab">Other</a>', content)
        self.assertNotIn('id="other"', content)

        # clean
        self.assertTrue(make_campaign_report.disconnect(handler))
Ejemplo n.º 2
0
    def test_add_campaign_report_item(self):
        def handler(context, **kwarg):
            context['tabs_layout']['Test'] = []

        make_campaign_report.connect(handler)

        # test
        content = self.get()
        self.assertIn(
            '<a href="#test" aria-controls="test" role="tab" '
            'data-toggle="tab">Test</a>', content)
        self.assertIn('id="test"', content)

        # clean
        self.assertTrue(make_campaign_report.disconnect(handler))