diff --git a/cms/djangoapps/contentstore/views/tests/test_videos.py b/cms/djangoapps/contentstore/views/tests/test_videos.py index f91b188d32..5f9751e51f 100644 --- a/cms/djangoapps/contentstore/views/tests/test_videos.py +++ b/cms/djangoapps/contentstore/views/tests/test_videos.py @@ -488,13 +488,13 @@ class VideosHandlerTestCase(VideoUploadTestMixin, CourseTestCase): # Test should fail if video not found self.assertEqual(True, False, 'Invalid edx_video_id') - def test_video_status_update_request(self): + @patch('contentstore.views.videos.LOGGER') + def test_video_status_update_request(self, mock_logger): """ Verifies that video status update request works as expected. """ url = self.get_url_for_course_key(self.course.id) edx_video_id = 'test1' - self.assert_video_status(url, edx_video_id, 'Uploading') response = self.client.post( @@ -506,6 +506,14 @@ class VideosHandlerTestCase(VideoUploadTestMixin, CourseTestCase): }]), content_type="application/json" ) + + mock_logger.info.assert_called_with( + 'VIDEOS: Video status update with id [%s], status [%s] and message [%s]', + edx_video_id, + 'upload_failed', + 'server down' + ) + self.assertEqual(response.status_code, 204) self.assert_video_status(url, edx_video_id, 'Failed') diff --git a/cms/djangoapps/contentstore/views/videos.py b/cms/djangoapps/contentstore/views/videos.py index 74441197cf..b40ceae83c 100644 --- a/cms/djangoapps/contentstore/views/videos.py +++ b/cms/djangoapps/contentstore/views/videos.py @@ -453,7 +453,12 @@ def send_video_status_update(updates): """ for update in updates: update_video_status(update.get('edxVideoId'), update.get('status')) - LOGGER.info(update.get('message')) + LOGGER.info( + 'VIDEOS: Video status update with id [%s], status [%s] and message [%s]', + update.get('edxVideoId'), + update.get('status'), + update.get('message') + ) return JsonResponse()