def setUpClass(cls): super(TestCaseTeamProjectResource, cls).setUpClass() cls.data_utils = data_helpers.DataHelpers() cls.user = UserFactory.create(username='******', is_partner=True) cls.team_owner = UserFactory.create(username='******') cls.data_utils.create_user_api_key(cls.user) #create an open team with description text and 2 members cls.open_team = TeamMemberFactory.create( team__name="Cool team", team__slug='team-with-projects', team__description='this is the coolest, most creative team ever', user=cls.team_owner, ).team TeamAdminMemberFactory(team=cls.open_team, user=cls.user) #Open to the teams page so you can see what's there. cls.project1 = TeamProjectFactory( team=cls.open_team, name='team project one', slug='team-project-one', description='subtitle project number 1', guidelines='do a good job', workflow_enabled=False) cls.project2 = TeamProjectFactory(team=cls.open_team, name='team project two', workflow_enabled=True) cls.team_pg = ATeamPage(cls) cls.team_pg.open_team_page(cls.open_team.slug)
def setUpClass(cls): super(TestCaseRollbackRevision, cls).setUpClass() cls.data_utils = data_helpers.DataHelpers() cls.video_lang_pg = video_language_page.VideoLanguagePage(cls) cls.diffing_pg = diffing_page.DiffingPage(cls) cls.video_pg = video_page.VideoPage(cls) cls.user = UserFactory.create() cls.owner = UserFactory.create() cls.team = TeamMemberFactory.create( team__workflow_enabled=True, team__translate_policy=20, #any team team__subtitle_policy=20, #any team team__task_assign_policy=10, #any team user=cls.owner, ).team cls.team_workflow = WorkflowFactory( team=cls.team, autocreate_subtitle=True, autocreate_translate=True, approve_allowed=10, # manager review_allowed=10, # peer ) lang_list = ['en', 'ru', 'pt-br', 'de', 'sv'] for language in lang_list: TeamLangPrefFactory.create(team=cls.team, language_code=language, preferred=True) cls.admin = TeamAdminMemberFactory(team=cls.team).user cls.contributor = TeamMemberFactory(team=cls.team).user cls.subs_dir = os.path.join(os.getcwd(), 'apps', 'webdriver_testing', 'subtitle_data')
def setUpClass(cls): super(TestCaseProjectsFilterSort, cls).setUpClass() #management.call_command('flush', interactive=False) cls.data_utils = data_helpers.DataHelpers() cls.videos_tab = videos_tab.VideosTab(cls) cls.team_owner = UserFactory.create() cls.logger.info('setup: Creating team Video Test') cls.team = TeamMemberFactory.create(user=cls.team_owner).team cls.manager_user = TeamAdminMemberFactory(team=cls.team, user=UserFactory()).user cls.logger.info('setup: Adding project one and project two with ' 'workflows enabled') cls.project1 = TeamProjectFactory.create( team=cls.team, workflow_enabled=True, ) cls.project2 = TeamProjectFactory.create(team=cls.team, workflow_enabled=True) data = json.load(open('apps/videos/fixtures/teams-list.json')) videos = _create_videos(data, []) for video in videos: TeamVideoFactory.create(team=cls.team, video=video, added_by=cls.manager_user, project=cls.project2) cls.videos_tab.open_videos_tab(cls.team.slug) cls.videos_tab.log_in(cls.manager_user.username, 'password')
def setUpClass(cls): super(TestCaseFilterSort, cls).setUpClass() #management.call_command('flush', interactive=False) cls.data_utils = data_helpers.DataHelpers() cls.logger.info("Create team 'video-test' and add 1 video") cls.team_owner = UserFactory.create(is_partner=True) cls.team = TeamMemberFactory.create(user=cls.team_owner).team cls.manager_user = TeamAdminMemberFactory(team=cls.team, user=UserFactory()).user cls.videos_tab = videos_tab.VideosTab(cls) vidurl_data = { 'url': 'http://www.youtube.com/watch?v=WqJineyEszo', 'video__title': 'X Factor Audition - Stop Looking At My Mom Rap', 'type': 'Y' } cls.test_video = cls.data_utils.create_video(**vidurl_data) cls.data_utils.upload_subs(cls.test_video) TeamVideoFactory.create(team=cls.team, video=cls.test_video, added_by=cls.manager_user) cls.data_utils.create_user_api_key(cls.team_owner) videos = cls.data_utils.create_several_team_videos_with_subs( cls.team, cls.manager_user) management.call_command('update_index', interactive=False)
def setUp(self): super(TestCaseAddRemoveEdit, self).setUp() #management.call_command('flush', interactive=False) self.data_utils = data_helpers.DataHelpers() self.logger.info("Create team and add 1 video") self.team_owner = UserFactory.create() self.team = TeamMemberFactory.create(user=self.team_owner).team self.manager_user = TeamAdminMemberFactory( team=self.team, user=UserFactory(username='******')).user self.videos_tab = videos_tab.VideosTab(self) data = { 'url': 'http://www.youtube.com/watch?v=WqJineyEszo', 'video__title': ('X Factor Audition - Stop Looking At My ' 'Mom Rap - Brian Bradley'), 'type': 'Y' } self.test_video = self.data_utils.create_video(**data) self.data_utils.upload_subs(self.test_video) TeamVideoFactory.create(team=self.team, video=self.test_video, added_by=self.manager_user) self.videos_tab.open_videos_tab(self.team.slug)
def setUpClass(cls): super(TestCaseManageMembers, cls).setUpClass() cls.members_tab = members_tab.MembersTab(cls) cls.team_owner = UserFactory.create() cls.team = TeamMemberFactory.create(team__membership_policy=1, user=cls.team_owner).team cls.manager = TeamManagerMemberFactory.create(team=cls.team).user cls.admin = TeamAdminMemberFactory.create(team=cls.team).user cls.member = TeamContributorMemberFactory.create(team=cls.team).user cls.members_tab.open_members_page(cls.team.slug)
def setUpClass(cls): super(TestCaseNoWorkflow, cls).setUpClass() cls.data_utils = data_helpers.DataHelpers() cls.video_lang_pg = video_language_page.VideoLanguagePage(cls) cls.video_pg = video_page.VideoPage(cls) cls.user = UserFactory.create() cls.owner = UserFactory.create() cls.team = TeamMemberFactory.create( team__translate_policy=20, #any team team__subtitle_policy=20, #any team user=cls.owner, ).team cls.admin = TeamAdminMemberFactory(team=cls.team).user cls.contributor = TeamMemberFactory(team=cls.team).user cls.subs_dir = os.path.join(os.getcwd(), 'apps', 'webdriver_testing', 'subtitle_data')
def test_admin__edit_link(self): """Video policy: admin only; admin sees edit link. """ self.logger.info('setup: Setting video policy to admin only') self.limited_access_team.video_policy = 3 self.limited_access_team.save() vids = self.add_some_team_videos() #Create a user who is a team admin. self.logger.info('Create a team admin and log in as that user') admin_member = TeamAdminMemberFactory( team=self.limited_access_team, user=UserFactory(username='******')).user self.videos_tab.log_in(admin_member.username, 'password') self.videos_tab.open_videos_tab(self.limited_access_team.slug) self.assertTrue(self.videos_tab.video_has_link(vids[0].title, 'Edit'))
def setUpClass(cls): super(TestCaseWorkflows, cls).setUpClass() cls.data_utils = data_helpers.DataHelpers() cls.video_lang_pg = video_language_page.VideoLanguagePage(cls) cls.video_pg = video_page.VideoPage(cls) cls.user = UserFactory.create() cls.owner = UserFactory.create() cls.basic_team = TeamMemberFactory.create( team__workflow_enabled=False, team__translate_policy=20, #any team team__subtitle_policy=20, #any team user=cls.owner, ).team cls.team = TeamMemberFactory.create( team__workflow_enabled=True, team__translate_policy=20, #any team team__subtitle_policy=20, #any team team__task_assign_policy=10, #any team user=cls.owner, ).team cls.workflow = WorkflowFactory( team=cls.team, autocreate_subtitle=True, autocreate_translate=True, approve_allowed=10, # manager review_allowed=10, # peer ) lang_list = ['en', 'ru', 'pt-br', 'de', 'sv'] for language in lang_list: TeamLangPrefFactory.create(team=cls.team, language_code=language, preferred=True) cls.admin = TeamAdminMemberFactory(team=cls.team).user cls.contributor = TeamContributorMemberFactory(team=cls.team).user cls.subs_dir = os.path.join(os.getcwd(), 'apps', 'webdriver_testing', 'subtitle_data') cls.rev1 = os.path.join(cls.subs_dir, 'Timed_text.en.srt') cls.rev2 = os.path.join(cls.subs_dir, 'Timed_text.rev2.en.srt') de = os.path.join(cls.subs_dir, 'Timed_text.rev3.en.srt') cls.sv = os.path.join(cls.subs_dir, 'Timed_text.sv.dfxp') #Create en source language 2 revisions - approved. cls.video, cls.tv = cls._add_team_video() cls._upload_subtitles(cls.video, 'en', cls.rev1, cls.contributor, complete=False) cls._upload_subtitles(cls.video, 'en', cls.rev2, cls.contributor) cls.data_utils.complete_review_task(cls.tv, 20, cls.admin) cls.data_utils.complete_approve_task(cls.tv, 20, cls.admin) #Add sv translation, reviewed cls._upload_translation(cls.video, 'sv', cls.sv, cls.contributor) cls.data_utils.complete_review_task(cls.tv, 20, cls.admin) #Add de translation complete waiting review cls._upload_translation(cls.video, 'de', cls.sv, cls.contributor) #Add ru translation, incomplete. cls._upload_translation(cls.video, 'ru', cls.sv, cls.contributor, complete=False) cls.video.subtitle_language('en').clear_tip_cache() sl_sv = cls.video.subtitle_language('sv').clear_tip_cache() cls.video_lang_pg.open_video_lang_page(cls.video.video_id, 'en')
def setUpClass(cls): super(TestCaseDeletion, cls).setUpClass() cls.data_utils = data_helpers.DataHelpers() cls.video_lang_pg = video_language_page.VideoLanguagePage(cls) cls.video_pg = video_page.VideoPage(cls) cls.tasks_tab = TasksTab(cls) cls.watch_pg = watch_page.WatchPage(cls) cls.sub_editor = subtitle_editor.SubtitleEditor(cls) cls.user = UserFactory.create() cls.owner = UserFactory.create() cls.team = TeamMemberFactory.create( team__workflow_enabled=True, team__translate_policy=20, #any team team__subtitle_policy=20, #any team team__task_assign_policy=10, #any team user=cls.owner, ).team cls.workflow = WorkflowFactory( team=cls.team, autocreate_subtitle=True, autocreate_translate=True, approve_allowed=10, # manager review_allowed=10, # peer ) lang_list = ['en', 'ru', 'pt-br', 'de', 'sv'] for language in lang_list: TeamLangPrefFactory.create(team=cls.team, language_code=language, preferred=True) cls.admin = TeamAdminMemberFactory(team=cls.team).user cls.contributor = TeamContributorMemberFactory(team=cls.team).user cls.subs_dir = os.path.join(os.getcwd(), 'apps', 'webdriver_testing', 'subtitle_data') cls.rev1 = os.path.join(cls.subs_dir, 'Timed_text.en.srt') cls.rev2 = os.path.join(cls.subs_dir, 'Timed_text.rev2.en.srt') cls.sv = os.path.join(cls.subs_dir, 'Timed_text.sv.dfxp') ru = os.path.join(cls.subs_dir, 'less_lines.ssa') cls.logger.info(""" Create video with en as primary audio lang. Subtitle, review and approve. Translate to: sv: reviewed de: complete, needs review ru: incomplete Delete Subtitle Language en + sv and de. """) #Create en source language 2 revisions - approved. cls.video, cls.tv = cls._add_team_video() cls._upload_subtitles(cls.video, 'en', cls.rev1, cls.contributor, complete=False) cls._upload_subtitles(cls.video, 'en', cls.rev2, cls.contributor) cls.data_utils.complete_review_task(cls.tv, 20, cls.admin) cls.data_utils.complete_approve_task(cls.tv, 20, cls.admin) #Add sv translation, reviewed cls._upload_translation(cls.video, 'sv', cls.sv, cls.contributor) cls.data_utils.complete_review_task(cls.tv, 20, cls.admin) #Add it translation, reviewed cls._upload_translation(cls.video, 'it', cls.sv, cls.contributor) cls.data_utils.complete_review_task(cls.tv, 20, cls.admin) #Add hr translation, needs review cls._upload_translation(cls.video, 'hr', cls.sv, cls.contributor) #Add de translation complete waiting review cls._upload_translation(cls.video, 'de', cls.sv, cls.contributor) #Add ru translation, incomplete. cls._upload_translation(cls.video, 'ru', cls.sv, cls.contributor, complete=False) cls.video_lang_pg.open_video_lang_page(cls.video.video_id, 'en') cls.video_lang_pg.log_in(cls.owner.username, 'password') cls.video_lang_pg.page_refresh() #Delete English subtitle language + Swedish and German cls.video_lang_pg.delete_subtitle_language(['Swedish', 'German']) management.call_command('update_index', interactive=False) management.call_command('update_video_metadata')
def setUpClass(cls): super(TestCaseUnpublishLast, cls).setUpClass() cls.data_utils = data_helpers.DataHelpers() cls.create_modal = dialogs.CreateLanguageSelection(cls) cls.sub_editor = subtitle_editor.SubtitleEditor(cls) cls.tasks_tab = TasksTab(cls) cls.video_pg = video_page.VideoPage(cls) cls.watch_pg = watch_page.WatchPage(cls) cls.user = UserFactory.create() cls.owner = UserFactory.create() cls.team = TeamMemberFactory.create( team__workflow_enabled=True, team__translate_policy=20, #any team team__subtitle_policy=20, #any team team__task_assign_policy=10, #any team user=cls.owner, ).team cls.workflow = WorkflowFactory( team=cls.team, autocreate_subtitle=True, autocreate_translate=True, approve_allowed=10, # manager review_allowed=10, # peer ) lang_list = ['en', 'ru', 'pt-br', 'de', 'sv'] for language in lang_list: TeamLangPrefFactory.create(team=cls.team, language_code=language, preferred=True) cls.admin = TeamAdminMemberFactory(team=cls.team).user cls.contributor = TeamMemberFactory(team=cls.team).user cls.subs_dir = os.path.join(os.getcwd(), 'apps', 'webdriver_testing', 'subtitle_data') cls.video, cls.tv = cls.create_source_with_multiple_revisions() translation = os.path.join(cls.subs_dir, 'Timed_text.sv.dfxp') #Upload subs - sv - incomplete, de - reviewed, ru - complete needs review cls.logger.info("""Uploading subs to get tasks in various stages: """) cls.logger.info(""" sv: translation started, incomplete ru: translation submitted, needs review de: translation reviewed, needs approve pt-br: not started """) cls._upload_lang(cls.video, translation, 'sv', cls.contributor) cls._upload_lang(cls.video, translation, 'de', cls.contributor, complete=True) cls.data_utils.complete_review_task(cls.tv, 20, cls.admin) cls._upload_lang(cls.video, translation, 'ru', cls.contributor, complete=True) cls.logger.info('Setting visibility override on v3 to private') cls.en = cls.video.subtitle_language('en') en_v3 = cls.en.get_tip(full=True) en_v3.visibility_override = 'private' en_v3.save() cls.tasks_tab.open_page('teams/%s/tasks/?lang=all&assignee=anyone' % cls.team.slug)