From 79b00c9af4aa6b4d8d498f5e1e78f9016a183503 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Thu, 3 Oct 2019 17:16:30 +0500 Subject: [PATCH] BOM-866 Dictionaries are being rendered into the HTML but in different order between python2 and python3 and failing tests in python3. The function parses and sorts the dictionary so that we get ordered data that can be compared in tests cases. --- .../courseware/tests/test_video_mongo.py | 69 ++++++++++++++----- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/lms/djangoapps/courseware/tests/test_video_mongo.py b/lms/djangoapps/courseware/tests/test_video_mongo.py index 2b089023e5..eef3e31301 100644 --- a/lms/djangoapps/courseware/tests/test_video_mongo.py +++ b/lms/djangoapps/courseware/tests/test_video_mongo.py @@ -5,6 +5,7 @@ Video xmodule tests in mongo. from __future__ import absolute_import +import ast import io import json import shutil @@ -74,7 +75,7 @@ I am overwatch. TRANSCRIPT_FILE_SJSON_DATA = """{\n "start": [10],\n "end": [100],\n "text": ["Hi, welcome to edxval."]\n}""" -class TestVideoYouTube(TestVideo): +class TestVideoYouTube(TestVideo): # pylint: disable=test-inherits-tests METADATA = {} def test_video_constructor(self): @@ -138,7 +139,7 @@ class TestVideoYouTube(TestVideo): ) -class TestVideoNonYouTube(TestVideo): +class TestVideoNonYouTube(TestVideo): # pylint: disable=test-inherits-tests """Integration tests: web client + mongo.""" DATA = """