def test_visible_contributor_to_property(self): invisible_contributor = factories.UserFactory() normal_node = factories.ProjectFactory(creator=invisible_contributor) deleted_node = factories.ProjectFactory(creator=invisible_contributor, is_deleted=True) bookmark_collection_node = factories.BookmarkCollectionFactory(creator=invisible_contributor) collection_node = factories.CollectionFactory(creator=invisible_contributor) project_to_be_invisible_on = factories.ProjectFactory() project_to_be_invisible_on.add_contributor(invisible_contributor, visible=False) project_to_be_invisible_on.save() visible_contributor_to_nodes = [node._id for node in invisible_contributor.visible_contributor_to] assert_in(normal_node._id, visible_contributor_to_nodes) assert_not_in(deleted_node._id, visible_contributor_to_nodes) assert_not_in(bookmark_collection_node._id, visible_contributor_to_nodes) assert_not_in(collection_node._id, visible_contributor_to_nodes) assert_not_in(project_to_be_invisible_on._id, visible_contributor_to_nodes)
def setUp(self): super(TestODMTitleSearch, self).setUp() self.user = factories.AuthUserFactory() self.user_two = factories.AuthUserFactory() self.project = factories.ProjectFactory(creator=self.user, title="foo") self.project_two = factories.ProjectFactory(creator=self.user_two, title="bar") self.public_project = factories.ProjectFactory(creator=self.user_two, is_public=True, title="baz") self.registration_project = factories.RegistrationFactory( creator=self.user, title="qux") self.folder = factories.CollectionFactory(creator=self.user, title="quux") self.dashboard = factories.BookmarkCollectionFactory(creator=self.user, title="Dashboard") self.url = api_url_for('search_projects_by_title')