'Scenario: Translations uploading works correctly
Given I have created a Video component
And I edit the component
And I open tab "Advanced"
And I upload transcript file "chinese_transcripts.srt" for "zh" language code
And I save changes
Then when I view the video it does show the captions
And I see "å¥œ åäœåå­Š" text in the captions
And I edit the component
And I open tab "Advanced"
And I see translations for "zh"
And I upload transcript file "uk_transcripts.srt" for "uk" language code
And I save changes
Then when I view the video it does show the captions
And I see "å¥œ åäœåå­Š" text in the captions
And video language menu has "uk, zh" translations'

def test_translations_uploading(self):

    self._create_video_component()
    self.edit_component()
    self.open_advanced_tab()
    self.video.upload_translation('chinese_transcripts.srt', 'zh')
    self.save_unit_settings()
    self.assertTrue(self.video.is_captions_visible())
    unicode_text = '\xe5\xa5\xbd    \xe5\x90\x84\xe4\xbd\x8d\xe5\x90\x8c\xe5\xad\xa6'.decode('utf-8')
    self.assertIn(unicode_text, self.video.captions_text)
    self.edit_component()
    self.open_advanced_tab()
    self.assertEqual(self.video.translations(), ['zh'])
    self.video.upload_translation('uk_transcripts.srt', 'uk')
    self.save_unit_settings()
    self.assertTrue(self.video.is_captions_visible())
    self.assertIn(unicode_text, self.video.captions_text)
    self.assertEqual(self.video.caption_languages.keys(), ['zh', 'uk'])
