'Scenario: User can easy replace the translation by another one w/o preliminary saving
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 see translations for "zh"
And I replace transcript file for "zh" language code by "uk_transcripts.srt"
And I save changes
Then when I view the video it does show the captions
And I see "ÐÑÐžÐ²ÑÑ, edX Ð²ÑÑÐ°Ñ Ð²Ð°Ñ." text in the captions'

def test_replace_translation_wo_save(self):

    self._create_video_component()
    self.edit_component()
    self.open_advanced_tab()
    self.video.upload_translation('chinese_transcripts.srt', 'zh')
    self.assertEqual(self.video.translations(), ['zh'])
    self.video.replace_translation('zh', 'uk', 'uk_transcripts.srt')
    self.save_unit_settings()
    self.assertTrue(self.video.is_captions_visible())
    unicode_text = '\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd1\x96\xd1\x82,    edX    \xd0\xb2\xd1\x96\xd1\x82\xd0\xb0\xd1\x94    \xd0\xb2\xd0\xb0\xd1\x81.'.decode('utf-8')
    self.assertIn(unicode_text, self.video.captions_text)
