def test_participants_text_filter(self):
        self.portal.REQUEST['searchable_text'] = 'sepp'

        handler = ParticipationHandler(self.dossier)
        sepp = handler.create_participation(contact='sepp',
                                            roles=['Reader', 'Editor'])
        handler.append_participiation(sepp)

        view = self.get_tabbed_view('tabbedview_view-participants')
        self.assertEqual(1, len(view.contents))
    def test_participants_text_filter(self):
        self.portal.REQUEST['searchable_text'] = 'sepp'

        handler = ParticipationHandler(self.dossier)
        sepp = handler.create_participation(
            contact='sepp', roles=['Reader', 'Editor'])
        handler.append_participiation(sepp)

        view = self.get_tabbed_view('tabbedview_view-participants')
        self.assertEqual(1, len(view.contents))
Example #3
0
    def test_participation_with_handler(self):
        self.replay()
        handler = ParticipationHandler(self.context)

        # creation
        peter = handler.create_participation(
            {'contact': 'peter', 'roles': ['Reader', ], })
        sepp = handler.create_participation(
            {'contact': 'sepp', 'roles': ['Reader', 'Editor'], })
        hugo = handler.create_participation(
            {'contact': 'hugo'})

        # test appending
        handler.append_participiation(peter)
        self.assertEquals(handler.get_participations(), [peter, ])

        handler.append_participiation(sepp)
        self.assertEquals(handler.get_participations(), [peter, sepp])

        # an existing participation should not be addable multiple time
        self.assertEquals(handler.append_participiation(peter), None)

        # test has participation
        self.assertEquals(handler.has_participation(peter), True)
        self.assertEquals(handler.has_participation(hugo), False)

        # test removing
        handler.remove_participation(peter)
        self.assertEquals(handler.get_participations(), [sepp, ])