def test_remove_user(self):
        add_roles(self.publication, 'editor', 'Editor', 'ChiefEditor')

        results = self.service.catalog.searchResults(users='editor')
        self.assertTrue(self.publication in results, 'publication should'
            ' show up in the results when querying for user editor')

        remove_roles(self.publication, 'editor')
        results = self.service.catalog.searchResults(users='editor')
        self.assertTrue(self.publication not in results,
            'publication should not show up in the results anymore')
    def test_multiple_users_add_remove_role(self):
        add_roles(self.publication, 'dummy', 'Reader')
        add_roles(self.publication, 'editor', 'Editor')

        results = self.service.catalog.searchResults(users='dummy')
        self.assertTrue(self.publication in results, 'publication should'
            ' show up in the results when querying for user dummy')

        results = self.service.catalog.searchResults(users='editor')
        self.assertTrue(self.publication in results, 'publication should'
            ' show up in the results when querying for user editor')

        add_roles(self.publication, 'editor', 'ChiefEditor')
        results = self.service.catalog.searchResults(users='editor')
        self.assertTrue(self.publication in results, 'publication should'
            ' show up in the results when querying for user editor')

        remove_roles(self.publication, 'editor')
        results = self.service.catalog.searchResults(users='editor')
        self.assertTrue(self.publication not in results, 'publication should'
            ' not be in the results anymore because all roles where removed'
            ' for user editor')