def test_view_project_pointer_count_excludes_folders(self): pointer_project = ProjectFactory(is_public=True) # project that points to another project pointed_project = self.node # project that other project points to pointer_project.add_pointer(pointed_project, Auth(pointer_project.creator), save=True) # Project is in a organizer collection folder = CollectionFactory(creator=pointed_project.creator) folder.add_pointer(pointed_project, Auth(pointed_project.creator), save=True) result = _view_project(pointed_project, Auth(pointed_project.creator)) # pointer_project is included in count, but not folder assert_equal(result['node']['points'], 1)
def collection_with_provider(self, user_one, project_one): c = CollectionFactory(creator=user_one) c.collect_object(project_one, user_one, status='asdf') return c
def collection_with_provider(self, user_one, submission_one): c = CollectionFactory(creator=user_one, status_choices=['asdf']) c.collect_object(submission_one, user_one, status='asdf') return c
def folder(self): return CollectionFactory()
def folder_deleted(self, user_one): return CollectionFactory(title='Deleted Folder User One', is_public=False, creator=user_one, is_deleted=True)
def collection(self): collection_provider = CollectionProviderFactory() return CollectionFactory(provider=collection_provider)
def project_deleted_user_one(self, user_one): return CollectionFactory(title='Deleted Project User One', is_public=False, creator=user_one, is_deleted=True)
def collection_with_provider(self, user_one, submission_one): c = CollectionFactory(creator=user_one, status_choices=['asdf']) c.collect_object(submission_one, user_one, status='asdf') return c
def collection_without_provider(self, user_one, submission_one): c = CollectionFactory(creator=user_one) c.collect_object(submission_one, user_one) return c
def collection_public(self, user): return CollectionFactory(creator=user, provider=CollectionProviderFactory(), is_public=True, status_choices=['', 'asdf', 'lkjh'], collected_type_choices=['', 'asdf', 'lkjh'], issue_choices=['', '0', '1', '2'], volume_choices=['', '0', '1', '2'], program_area_choices=['', 'asdf', 'lkjh'])
def registration_collection(self, user): return CollectionFactory(creator=user, provider=RegistrationProviderFactory(), is_public=True, status_choices=['', 'asdf', 'lkjh'], collected_type_choices=['', 'asdf', 'lkjh'])
def collection(self, user_admin_project_public): return CollectionFactory(creator=user_admin_project_public)
def collection_with_provider(self, user_one, project_one): c = CollectionFactory(creator=user_one) c.collect_object(project_one, user_one, status='asdf') return c
def collection_public(self, user): return CollectionFactory(creator=user, provider=CollectionProviderFactory(), is_public=True, is_bookmark_collection=False)
def collection_without_provider(self, user_one, project_one): c = CollectionFactory(creator=user_one) c.collect_object(project_one, user_one) return c
def deleted_folder(self, user_one): return CollectionFactory(title='Deleted Folder User One', is_public=False, creator=user_one, deleted=now())
def test_collection_guid_not_found(self): collection = CollectionFactory() collection.collect_object(self.project, self.auth.user) with assert_raises(HTTPError) as exc_info: valid_project_helper(pid=collection._id, nid=collection._id) assert_equal(exc_info.exception.code, 404)
def test_collection_guid_not_found(self): collection = CollectionFactory() collection.collect_object(self.project, self.auth.user) with assert_raises(HTTPError) as exc_info: valid_project_helper(pid=collection._id, nid=collection._id) assert_equal(exc_info.exception.code, 404)