assertItemsEqual with six.assertCountEqual
This commit is contained in:
Ayub khan
2019-08-21 16:26:12 +05:00
parent acf3cb684d
commit 8a95a8e520
43 changed files with 167 additions and 103 deletions

View File

@@ -803,8 +803,8 @@ class ProblemWithUploadedFilesTest(TestSubmittingProblems):
self.assertEqual(name, "post")
self.assertEqual(len(args), 1)
self.assertTrue(args[0].endswith("/submit/"))
self.assertItemsEqual(list(kwargs.keys()), ["files", "data", "timeout"])
self.assertItemsEqual(list(kwargs['files'].keys()), filenames.split())
six.assertCountEqual(self, list(kwargs.keys()), ["files", "data", "timeout"])
six.assertCountEqual(self, list(kwargs['files'].keys()), filenames.split())
class TestPythonGradedResponse(TestSubmittingProblems):

View File

@@ -366,7 +366,7 @@ class TestTranscriptAvailableTranslationsDispatch(TestVideo):
# Make request to available translations dispatch.
request = Request.blank('/available_translations')
response = self.item.transcript(request=request, dispatch='available_translations')
self.assertItemsEqual(json.loads(response.body), result)
six.assertCountEqual(self, json.loads(response.body), result)
@patch('xmodule.video_module.transcripts_utils.edxval_api.get_available_transcript_languages')
def test_val_available_translations_feature_disabled(self, mock_get_available_transcript_languages):

View File

@@ -1576,7 +1576,7 @@ class TestVideoBlockStudentViewJson(BaseTestVideoXBlock, CacheIsolationTestCase)
self.video.transcripts = transcripts
self.video.sub = english_sub
student_view_response = self.get_result()
self.assertItemsEqual(list(student_view_response['transcripts'].keys()), expected_transcripts)
six.assertCountEqual(self, list(student_view_response['transcripts'].keys()), expected_transcripts)
@ddt.ddt