예제 #1
0
 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
예제 #2
0
파일: test_views.py 프로젝트: leb2dg/osf.io
 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
0
파일: test_views.py 프로젝트: adlius/osf.io
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()
예제 #4
0
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()