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


Python NodeFactory.add_tag方法代码示例

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


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

示例1: component_public

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

示例2: ApiSearchTestCase

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


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