'Make sure that if the \'youtube\' attribute is omitted in XML, then
the template generates an empty string for the YouTube streams.'

def test_video_constructor(self):

    context = self.item_descriptor.render(STUDENT_VIEW).content
    sources = [u'example.mp4', u'example.webm']
    expected_context = {'branding_info': None, 'license': None, 'bumper_metadata': 'null', 'cdn_eval': False, 'cdn_exp_group': None, 'display_name': u'A    Name', 'download_video_link': u'example.mp4', 'handout': None, 'id': self.item_descriptor.location.html_id(), 'metadata': json.dumps(OrderedDict({'saveStateUrl': (self.item_descriptor.xmodule_runtime.ajax_url + '/save_user_state'), 'autoplay': False, 'streams': '1.00:3_yD_cEKoCk', 'sub': 'a_sub_file.srt.sjson', 'sources': sources, 'poster': None, 'captionDataDir': None, 'showCaptions': 'true', 'generalSpeed': 1.0, 'speed': None, 'savedVideoPosition': 0.0, 'start': 3603.0, 'end': 3610.0, 'transcriptLanguage': 'en', 'transcriptLanguages': OrderedDict({'en': 'English'}), 'ytTestTimeout': 1500, 'ytApiUrl': 'https://www.youtube.com/iframe_api', 'ytMetadataUrl': 'https://www.googleapis.com/youtube/v3/videos/', 'ytKey': None, 'transcriptTranslationUrl': self.item_descriptor.xmodule_runtime.handler_url(self.item_descriptor, 'transcript', 'translation/__lang__').rstrip('/?'), 'transcriptAvailableTranslationsUrl': self.item_descriptor.xmodule_runtime.handler_url(self.item_descriptor, 'transcript', 'available_translations').rstrip('/?'), 'autohideHtml5': False, 'recordedYoutubeIsAvailable': True})), 'track': None, 'transcript_download_format': u'srt', 'transcript_download_formats_list': [{'display_name': 'SubRip    (.srt)    file', 'value': 'srt'}, {'display_name': 'Text    (.txt)    file', 'value': 'txt'}], 'poster': 'null'}
    self.assertEqual(context, self.item_descriptor.xmodule_runtime.render_template('video.html', expected_context))
