diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py b/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py index 88940ace83..12302f5a69 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py @@ -105,8 +105,7 @@ class TestGitExport(CourseTestCase): with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.URL_BAD)): git_export_utils.export_to_git(course_key, 'example.com:edx/notreal') - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.URL_NO_AUTH)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.URL_NO_AUTH)): git_export_utils.export_to_git(course_key, 'http://blah') def test_bad_git_repos(self): @@ -117,23 +116,20 @@ class TestGitExport(CourseTestCase): self.assertFalse(os.path.isdir(test_repo_path)) course_key = CourseLocator('foo', 'blah', '100-') # Test bad clones - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.CANNOT_PULL)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.CANNOT_PULL)): git_export_utils.export_to_git( course_key, 'https://user:blah@example.com/test_repo.git') self.assertFalse(os.path.isdir(test_repo_path)) # Setup good repo with bad course to test xml export - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.XML_EXPORT_FAIL)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.XML_EXPORT_FAIL)): git_export_utils.export_to_git( course_key, 'file://{0}'.format(self.bare_repo_dir)) # Test bad git remote after successful clone - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.CANNOT_PULL)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.CANNOT_PULL)): git_export_utils.export_to_git( course_key, 'https://user:blah@example.com/r.git') @@ -189,7 +185,6 @@ class TestGitExport(CourseTestCase): 'file://{0}'.format(self.bare_repo_dir) ) - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.CANNOT_COMMIT)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.CANNOT_COMMIT)): git_export_utils.export_to_git( self.course.id, 'file://{0}'.format(self.bare_repo_dir)) diff --git a/cms/djangoapps/contentstore/tests/test_utils.py b/cms/djangoapps/contentstore/tests/test_utils.py index 03c3378883..eeba617e4b 100644 --- a/cms/djangoapps/contentstore/tests/test_utils.py +++ b/cms/djangoapps/contentstore/tests/test_utils.py @@ -28,7 +28,7 @@ class LMSLinksTestCase(TestCase): location = course_key.make_usage_key('vertical', 'contacting_us') link = utils.get_lms_link_for_item(location, False) self.assertEqual(link, "//localhost:8000/courses/course-v1:mitX+101+test/jump_to/block-v1:mitX+101+test+type" - "@vertical+block@contacting_us") + "@vertical+block@contacting_us") # test preview link = utils.get_lms_link_for_item(location, True) @@ -42,7 +42,7 @@ class LMSLinksTestCase(TestCase): location = course_key.make_usage_key('course', 'test') link = utils.get_lms_link_for_item(location) self.assertEqual(link, "//localhost:8000/courses/course-v1:mitX+101+test/jump_to/block-v1:mitX+101+test+type" - "@course+block@test") + "@course+block@test") def lms_link_for_certificate_web_view_test(self): """ Tests get_lms_link_for_certificate_web_view. """ diff --git a/cms/djangoapps/contentstore/views/tests/test_item.py b/cms/djangoapps/contentstore/views/tests/test_item.py index e25f03b8dd..1de35c6deb 100644 --- a/cms/djangoapps/contentstore/views/tests/test_item.py +++ b/cms/djangoapps/contentstore/views/tests/test_item.py @@ -2194,7 +2194,7 @@ class TestComponentHandler(TestCase): self.descriptor.handle = create_response self.assertEqual(component_handler(self.request, self.usage_key_string, 'dummy_handler').status_code, - status_code) + status_code) @ddt.data((True, True), (False, False),) @ddt.unpack diff --git a/common/lib/capa/capa/tests/test_responsetypes.py b/common/lib/capa/capa/tests/test_responsetypes.py index 0aa237549b..486778a4e4 100644 --- a/common/lib/capa/capa/tests/test_responsetypes.py +++ b/common/lib/capa/capa/tests/test_responsetypes.py @@ -481,13 +481,13 @@ class FormulaResponseTest(ResponseTest): input_dict = {'1_2_1': "x + 2*y + y"} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - 'Check the coefficient of y') + 'Check the coefficient of y') # Expect to receive a hint if we leave out x input_dict = {'1_2_1': "2*y"} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - 'Try including the variable x') + 'Try including the variable x') def test_script(self): """ @@ -819,13 +819,13 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring input_dict = {'1_2_1': 'Wisconsin'} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - "The state capital of Wisconsin is Madison") + "The state capital of Wisconsin is Madison") # We should get a hint for Minnesota input_dict = {'1_2_1': 'Minnesota'} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - "The state capital of Minnesota is St. Paul") + "The state capital of Minnesota is St. Paul") # We should NOT get a hint for Michigan (the correct answer) input_dict = {'1_2_1': 'Michigan'} @@ -868,13 +868,13 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring input_dict = {'1_2_1': 'Wisconsin'} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - "The state capital of Wisconsin is Madison") + "The state capital of Wisconsin is Madison") # We should get a hint for Minnesota input_dict = {'1_2_1': 'Minnesota'} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - "The state capital of Minnesota is St. Paul") + "The state capital of Minnesota is St. Paul") # We should NOT get a hint for Michigan (the correct answer) input_dict = {'1_2_1': 'Michigan'} diff --git a/common/lib/capa/capa/tests/test_shuffle.py b/common/lib/capa/capa/tests/test_shuffle.py index 6a7cd567de..22a3ee9498 100644 --- a/common/lib/capa/capa/tests/test_shuffle.py +++ b/common/lib/capa/capa/tests/test_shuffle.py @@ -279,7 +279,7 @@ class CapaShuffleTest(unittest.TestCase): html = orig_html.replace('\n', ' ') # avoid headaches with .* matching print(html) self.assertRegex(html, r"
.*\[.*'Banana'.*'Apple'.*'Chocolate'.*'Donut'.*\].*
.*" + - r"
.*\[.*'C'.*'A'.*'D'.*'B'.*\].*
") + r"
.*\[.*'C'.*'A'.*'D'.*'B'.*\].*
") # Look at the responses in their authored order responses = sorted(list(problem.responders.values()), key=lambda resp: int(resp.id[resp.id.rindex('_') + 1:])) self.assertFalse(responses[0].has_mask()) diff --git a/common/lib/capa/capa/tests/test_targeted_feedback.py b/common/lib/capa/capa/tests/test_targeted_feedback.py index 5dfbf54070..4cfea1935c 100644 --- a/common/lib/capa/capa/tests/test_targeted_feedback.py +++ b/common/lib/capa/capa/tests/test_targeted_feedback.py @@ -130,7 +130,7 @@ class CapaTargetedFeedbackTest(unittest.TestCase): without_new_lines = the_html.replace("\\n", "").replace("\n", "") # pylint: disable=line-too-long self.assertRegex(without_new_lines, - r"\s*Correct.*Feedback on your correct solution...") + r"\s*Correct.*Feedback on your correct solution...") self.assertNotRegexpMatches(without_new_lines, r"feedback1|feedback2|feedback3") def test_targeted_feedback_id_typos(self): diff --git a/lms/djangoapps/bulk_email/tests/test_email.py b/lms/djangoapps/bulk_email/tests/test_email.py index 796365f589..92af7fbf8d 100644 --- a/lms/djangoapps/bulk_email/tests/test_email.py +++ b/lms/djangoapps/bulk_email/tests/test_email.py @@ -595,7 +595,7 @@ class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase) self.assertEqual(json.loads(response.content.decode('utf-8')), self.success_content) self.assertEqual(mock_factory.emails_sent, - 1 + len(self.staff) + len(self.students) + LARGE_NUM_EMAILS - len(optouts)) + 1 + len(self.staff) + len(self.students) + LARGE_NUM_EMAILS - len(optouts)) outbox_contents = [e.to[0] for e in mail.outbox] should_send_contents = ([self.instructor.email] + [s.email for s in self.staff] + @@ -668,14 +668,14 @@ class TestCourseEmailContext(SharedModuleStoreTestCase): self.assertEqual(email_context['platform_name'], settings.PLATFORM_NAME) self.assertEqual(email_context['course_title'], self.course_title) self.assertEqual(email_context['course_url'], - '{}://edx.org/courses/{}/{}/{}/'.format(scheme, - self.course_org, - self.course_number, - self.course_run)) + '{}://edx.org/courses/{}/{}/{}/'.format(scheme, + self.course_org, + self.course_number, + self.course_run)) self.assertEqual(email_context['course_image_url'], - '{}://edx.org/c4x/{}/{}/asset/images_course_image.jpg'.format(scheme, - self.course_org, - self.course_number)) + '{}://edx.org/c4x/{}/{}/asset/images_course_image.jpg'.format(scheme, + self.course_org, + self.course_number)) self.assertEqual(email_context['email_settings_url'], '{}://edx.org/dashboard'.format(scheme)) self.assertEqual(email_context['account_settings_url'], '{}://edx.org/account/settings'.format(scheme)) diff --git a/lms/djangoapps/instructor/tests/test_certificates.py b/lms/djangoapps/instructor/tests/test_certificates.py index d2f73cde4a..acb3819359 100644 --- a/lms/djangoapps/instructor/tests/test_certificates.py +++ b/lms/djangoapps/instructor/tests/test_certificates.py @@ -962,7 +962,7 @@ class TestCertificatesInstructorApiBulkWhiteListExceptions(SharedModuleStoreTest data = json.loads(response.content.decode('utf-8')) self.assertNotEqual(len(data['general_errors']), 0) self.assertEqual(data['general_errors'][0], 'Make sure that the file you upload is in CSV format with ' - 'no extraneous characters or rows.') + 'no extraneous characters or rows.') def test_bad_file_upload_type(self): """ diff --git a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py index 7e4cc5f445..919a0b28eb 100644 --- a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py +++ b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py @@ -455,8 +455,8 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT response = self.client.get(self.url) self.assertEqual(expected_result, - 'CCX Coaches are able to create their own Custom Courses based on this course' - in response.content.decode('utf-8')) + 'CCX Coaches are able to create their own Custom Courses based on this course' + in response.content.decode('utf-8')) def test_grade_cutoffs(self): """