@@ -234,6 +234,18 @@ class TestCreateYoutubeString(VideoDescriptorTestBase):
|
|||||||
self.assertEqual(create_youtube_string(self.descriptor), expected)
|
self.assertEqual(create_youtube_string(self.descriptor), expected)
|
||||||
|
|
||||||
|
|
||||||
|
class TestCreateYouTubeUrl(VideoDescriptorTestBase):
|
||||||
|
"""
|
||||||
|
Tests for helper method `create_youtube_url`.
|
||||||
|
"""
|
||||||
|
def test_create_youtube_url_unicode(self):
|
||||||
|
"""
|
||||||
|
Test that passing unicode to `create_youtube_url` doesn't throw
|
||||||
|
an error.
|
||||||
|
"""
|
||||||
|
self.descriptor.create_youtube_url(u"üñîçø∂é")
|
||||||
|
|
||||||
|
|
||||||
@ddt.ddt
|
@ddt.ddt
|
||||||
class VideoDescriptorImportTestCase(unittest.TestCase):
|
class VideoDescriptorImportTestCase(unittest.TestCase):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -619,9 +619,9 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
|
|||||||
A full youtube url to the video whose ID is passed in
|
A full youtube url to the video whose ID is passed in
|
||||||
"""
|
"""
|
||||||
if youtube_id:
|
if youtube_id:
|
||||||
return 'https://www.youtube.com/watch?v={0}'.format(youtube_id)
|
return u'https://www.youtube.com/watch?v={0}'.format(youtube_id)
|
||||||
else:
|
else:
|
||||||
return ''
|
return u''
|
||||||
|
|
||||||
def get_context(self):
|
def get_context(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user