Commit ba00a5f2 by Christopher Lee

Merge pull request #35 from edx/clee/get_url_for_profile_bug

fixed get_url_for_profile
parents 8778a639 7a6d5fc9
......@@ -220,12 +220,10 @@ def get_url_for_profile(edx_video_id, profile):
profile (str): a string of the profile we are searching
Returns:
A dict containing the profile to url. The return type is the same as
get_urls_for_profiles for consistency.
A string with the url
"""
url = get_urls_for_profiles(edx_video_id, [profile])[profile]
return {profile: url}
return get_urls_for_profiles(edx_video_id, [profile])[profile]
def get_videos_for_course(course_id):
......
......@@ -265,9 +265,8 @@ class GetUrlsForProfileTest(TestCase):
"""
profile = "mobile"
edx_video_id = constants.VIDEO_DICT_FISH['edx_video_id']
urls = api.get_url_for_profile(edx_video_id, profile)
self.assertEqual(len(urls), 1)
self.assertEqual(urls["mobile"], u'http://www.meowmix.com')
url = api.get_url_for_profile(edx_video_id, profile)
self.assertEqual(url, u'http://www.meowmix.com')
class GetVideosForIds(TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment