From c90aa33cb8dc17dc835c46c43039589659137ac1 Mon Sep 17 00:00:00 2001 From: Qubad786 Date: Wed, 14 Feb 2018 19:23:04 +0500 Subject: [PATCH] Integrate with the updated VAL api utils. --- .../tests/test_transcripts_utils.py | 4 +- .../views/tests/test_transcript_settings.py | 2 +- .../views/tests/test_transcripts.py | 4 +- .../contentstore/views/transcript_settings.py | 6 +- .../contentstore/views/transcripts_ajax.py | 24 +++---- cms/djangoapps/contentstore/views/videos.py | 2 +- .../xmodule/video_module/transcripts_utils.py | 66 ++++++++++++------- .../xmodule/video_module/video_handlers.py | 38 ++++------- .../courseware/tests/test_video_handlers.py | 9 ++- .../courseware/tests/test_video_mongo.py | 4 +- .../mobile_api/video_outlines/views.py | 17 ++--- requirements/edx/base.txt | 2 +- requirements/edx/github.txt | 1 + 13 files changed, 89 insertions(+), 90 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_transcripts_utils.py b/cms/djangoapps/contentstore/tests/test_transcripts_utils.py index 84e9a497c9..ae2db05e31 100644 --- a/cms/djangoapps/contentstore/tests/test_transcripts_utils.py +++ b/cms/djangoapps/contentstore/tests/test_transcripts_utils.py @@ -647,9 +647,9 @@ class TestTranscript(unittest.TestCase): """ Tests that the srt transcript is successfully converted into sjson format. """ - expected = json.loads(self.sjson_transcript) + expected = self.sjson_transcript actual = transcripts_utils.Transcript.convert(self.srt_transcript, 'srt', 'sjson') - self.assertDictEqual(actual, expected) + self.assertDictEqual(json.loads(actual), json.loads(expected)) def test_convert_invalid_srt_to_sjson(self): """ diff --git a/cms/djangoapps/contentstore/views/tests/test_transcript_settings.py b/cms/djangoapps/contentstore/views/tests/test_transcript_settings.py index 40174725b4..443131af6b 100644 --- a/cms/djangoapps/contentstore/views/tests/test_transcript_settings.py +++ b/cms/djangoapps/contentstore/views/tests/test_transcript_settings.py @@ -578,4 +578,4 @@ class TranscriptUploadTest(CourseTestCase): language_code=language_code )) self.assertEqual(response.status_code, 200) - self.assertFalse(api.get_video_transcript_data([video_id], language_code=language_code)) + self.assertFalse(api.get_video_transcript_data(video_id=video_id, language_code=language_code)) diff --git a/cms/djangoapps/contentstore/views/tests/test_transcripts.py b/cms/djangoapps/contentstore/views/tests/test_transcripts.py index 0db2f2c549..9d99c072d9 100644 --- a/cms/djangoapps/contentstore/views/tests/test_transcripts.py +++ b/cms/djangoapps/contentstore/views/tests/test_transcripts.py @@ -542,7 +542,7 @@ class TestDownloadTranscripts(BaseTranscripts): } self.item.data = textwrap.dedent(""" -