当前位置: 首页>>代码示例>>Python>>正文


Python ProjectFactory.set_description方法代码示例

本文整理汇总了Python中tests.factories.ProjectFactory.set_description方法的典型用法代码示例。如果您正苦于以下问题:Python ProjectFactory.set_description方法的具体用法?Python ProjectFactory.set_description怎么用?Python ProjectFactory.set_description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.factories.ProjectFactory的用法示例。


在下文中一共展示了ProjectFactory.set_description方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ApiSearchTestCase

# 需要导入模块: from tests.factories import ProjectFactory [as 别名]
# 或者: from tests.factories.ProjectFactory 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.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()
开发者ID:alexschiller,项目名称:osf.io,代码行数:42,代码来源:test_views.py


注:本文中的tests.factories.ProjectFactory.set_description方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。