本文整理汇总了Python中osf_tests.factories.NodeFactory.set_description方法的典型用法代码示例。如果您正苦于以下问题:Python NodeFactory.set_description方法的具体用法?Python NodeFactory.set_description怎么用?Python NodeFactory.set_description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osf_tests.factories.NodeFactory
的用法示例。
在下文中一共展示了NodeFactory.set_description方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: node_with_abstract
# 需要导入模块: from osf_tests.factories import NodeFactory [as 别名]
# 或者: from osf_tests.factories.NodeFactory import set_description [as 别名]
def node_with_abstract(self, user):
node_with_abstract = NodeFactory(title='Sambolera', creator=user, is_public=True)
node_with_abstract.set_description(
'Sambolera by Khadja Nin',
auth=Auth(user),
save=True)
return node_with_abstract
示例2: component_public
# 需要导入模块: from osf_tests.factories import NodeFactory [as 别名]
# 或者: from osf_tests.factories.NodeFactory import set_description [as 别名]
def component_public(self, user_two, project_public):
component_public = NodeFactory(
parent=project_public,
title='Ultralight Beam',
creator=user_two,
is_public=True)
component_public.set_description(
'This is my part, nobody else speak',
auth=Auth(user_two),
save=True)
component_public.add_tag('trumpets', auth=Auth(user_two), save=True)
return component_public
示例3: ApiSearchTestCase
# 需要导入模块: from osf_tests.factories import NodeFactory [as 别名]
# 或者: from osf_tests.factories.NodeFactory import set_description [as 别名]
class ApiSearchTestCase(ApiTestCase):
def setUp(self):
super(ApiSearchTestCase, self).setUp()
self.user = AuthUserFactory()
self.user_one = AuthUserFactory(fullname='Kanye Omari West')
self.user_one.schools = [{
'degree': 'English',
'institution': 'Chicago State University'
}]
self.user_one.jobs = [{
'title': 'Producer',
'institution': 'GOOD Music, Inc.'
}]
self.user_one.save()
self.user_two = AuthUserFactory(fullname='Chance The Rapper')
self.institution = InstitutionFactory(name='Social Experiment')
self.user_two.affiliated_institutions.add(self.institution)
self.user_two.save()
# self.institution.save()
self.project = ProjectFactory(title='The Life of Pablo', creator=self.user_one, is_public=True)
self.project.set_description('Name one genius who ain\'t crazy', auth=Auth(self.user_one), save=True)
self.project.add_tag('Yeezus', auth=Auth(self.user_one), save=True)
self.project_two = ProjectFactory(title='Graduation', creator=self.user_one, is_public=True)
self.private_project = ProjectFactory(title='Coloring Book', creator=self.user_two)
self.component = NodeFactory(parent=self.project, title='Ultralight Beam', creator=self.user_two, is_public=True)
self.component.set_description('This is my part, nobody else speak', auth=Auth(self.user_two), save=True)
self.component.add_tag('trumpets', auth=Auth(self.user_two), save=True)
self.component_two = NodeFactory(parent=self.project, title='Highlights', creator=self.user_one, is_public=True)
self.private_component = NodeFactory(parent=self.project, title='Wavves', creator=self.user_one)
self.file = utils.create_test_file(self.component, self.user_one, filename='UltralightBeam.mp3')
self.file_two = utils.create_test_file(self.component_two, self.user_one, filename='Highlights.mp3')
self.private_file = utils.create_test_file(self.private_component, self.user_one, filename='Wavves.mp3')
def tearDown(self):
super(ApiSearchTestCase, self).tearDown()
search.delete_all()