Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
This commit is contained in:
@@ -78,7 +78,7 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
|
||||
Selects the cohort with the given name and verifies the expected description is presented.
|
||||
"""
|
||||
self.cohort_management_page.select_cohort(cohort_name)
|
||||
self.assertEquals(self.cohort_management_page.get_selected_cohort(), cohort_name)
|
||||
self.assertEqual(self.cohort_management_page.get_selected_cohort(), cohort_name)
|
||||
self.assertIn(expected_description, self.cohort_management_page.get_cohort_group_setup())
|
||||
|
||||
def test_cohort_description(self):
|
||||
@@ -674,7 +674,7 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin
|
||||
lambda: 1 == len(self.cohort_management_page.get_csv_messages()), 'Waiting for notification'
|
||||
).fulfill()
|
||||
messages = self.cohort_management_page.get_csv_messages()
|
||||
self.assertEquals(expected_message, messages[0])
|
||||
self.assertEqual(expected_message, messages[0])
|
||||
|
||||
@attr('a11y')
|
||||
def test_cohorts_management_a11y(self):
|
||||
@@ -747,7 +747,7 @@ class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin):
|
||||
self.cohort_management_page.select_cohort(self.cohort_name)
|
||||
self.assertIsNone(self.cohort_management_page.get_cohort_associated_content_group())
|
||||
self.assertIsNone(self.cohort_management_page.get_cohort_related_content_group_message())
|
||||
self.assertEquals(["Apples", "Bananas"], self.cohort_management_page.get_all_content_groups())
|
||||
self.assertEqual(["Apples", "Bananas"], self.cohort_management_page.get_all_content_groups())
|
||||
|
||||
def test_link_to_content_group(self):
|
||||
"""
|
||||
@@ -837,7 +837,7 @@ class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin):
|
||||
self.cohort_management_page.wait_for_page()
|
||||
self.cohort_management_page.select_cohort(new_cohort)
|
||||
self.assertEqual("Deleted Content Group", self.cohort_management_page.get_cohort_associated_content_group())
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
["Bananas", "Pears", "Deleted Content Group"],
|
||||
self.cohort_management_page.get_all_content_groups()
|
||||
)
|
||||
@@ -849,7 +849,7 @@ class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin):
|
||||
confirmation_messages = self.cohort_management_page.get_cohort_settings_messages()
|
||||
self.assertEqual(["Saved cohort"], confirmation_messages)
|
||||
self.assertIsNone(self.cohort_management_page.get_cohort_related_content_group_message())
|
||||
self.assertEquals(["Bananas", "Pears"], self.cohort_management_page.get_all_content_groups())
|
||||
self.assertEqual(["Bananas", "Pears"], self.cohort_management_page.get_all_content_groups())
|
||||
|
||||
def _create_new_cohort_linked_to_content_group(self, new_cohort, cohort_group):
|
||||
"""
|
||||
|
||||
@@ -26,7 +26,7 @@ class NonCohortedDiscussionTestMixin(BaseDiscussionMixin):
|
||||
|
||||
def test_non_cohort_visibility_label(self):
|
||||
self.setup_thread(1)
|
||||
self.assertEquals(self.thread_page.get_group_visibility_label(), "This post is visible to everyone.")
|
||||
self.assertEqual(self.thread_page.get_group_visibility_label(), "This post is visible to everyone.")
|
||||
|
||||
|
||||
class CohortedDiscussionTestMixin(BaseDiscussionMixin, CohortTestMixin):
|
||||
@@ -50,7 +50,7 @@ class CohortedDiscussionTestMixin(BaseDiscussionMixin, CohortTestMixin):
|
||||
self.enable_cohorting(self.course_fixture)
|
||||
self.enable_always_divide_inline_discussions(self.course_fixture)
|
||||
self.refresh_thread_page(self.thread_id)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.thread_page.get_group_visibility_label(),
|
||||
u"This post is visible only to {}.".format(self.cohort_1_name)
|
||||
)
|
||||
@@ -58,7 +58,7 @@ class CohortedDiscussionTestMixin(BaseDiscussionMixin, CohortTestMixin):
|
||||
# Disable cohorts and verify that the post now shows as visible to everyone.
|
||||
self.disable_cohorting(self.course_fixture)
|
||||
self.refresh_thread_page(self.thread_id)
|
||||
self.assertEquals(self.thread_page.get_group_visibility_label(), "This post is visible to everyone.")
|
||||
self.assertEqual(self.thread_page.get_group_visibility_label(), "This post is visible to everyone.")
|
||||
|
||||
|
||||
class DiscussionTabSingleThreadTest(BaseDiscussionTestCase):
|
||||
|
||||
@@ -482,7 +482,7 @@ class DivisionSchemeTest(BaseDividedDiscussionTest, BaseDiscussionMixin):
|
||||
self.setup_thread(1, group_id=-1)
|
||||
|
||||
refresh_thread_page()
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.thread_page.get_group_visibility_label(),
|
||||
u"This post is visible only to {}.".format("Audit")
|
||||
)
|
||||
@@ -493,4 +493,4 @@ class DivisionSchemeTest(BaseDividedDiscussionTest, BaseDiscussionMixin):
|
||||
self.verify_save_confirmation_message(self.scheme_key)
|
||||
|
||||
self.thread_page.visit()
|
||||
self.assertEquals(self.thread_page.get_group_visibility_label(), "This post is visible to everyone.")
|
||||
self.assertEqual(self.thread_page.get_group_visibility_label(), "This post is visible to everyone.")
|
||||
|
||||
@@ -648,7 +648,7 @@ class EventsTestMixin(TestCase):
|
||||
lambda: matching_events
|
||||
)
|
||||
|
||||
self.assertEquals(len(matching_events), 0, description)
|
||||
self.assertEqual(len(matching_events), 0, description)
|
||||
|
||||
def assert_events_match(self, expected_events, actual_events, in_order=True):
|
||||
"""Assert that each actual event matches one of the expected events.
|
||||
|
||||
@@ -531,9 +531,9 @@ class CoursewareMultipleVerticalsTest(CoursewareMultipleVerticalsTestBase):
|
||||
Verifies that the navigation state is as expected.
|
||||
"""
|
||||
self.assertTrue(self.courseware_page.nav.is_on_section(section_title, subsection_title))
|
||||
self.assertEquals(self.courseware_page.sequential_position, subsection_position)
|
||||
self.assertEquals(self.courseware_page.is_next_button_enabled, next_enabled)
|
||||
self.assertEquals(self.courseware_page.is_previous_button_enabled, prev_enabled)
|
||||
self.assertEqual(self.courseware_page.sequential_position, subsection_position)
|
||||
self.assertEqual(self.courseware_page.is_next_button_enabled, next_enabled)
|
||||
self.assertEqual(self.courseware_page.is_previous_button_enabled, prev_enabled)
|
||||
|
||||
def test_tab_position(self):
|
||||
# test that using the position in the url direct to correct tab in courseware
|
||||
|
||||
@@ -180,7 +180,7 @@ class AutoEnrollmentWithCSVTest(BaseInstructorDashboardTest):
|
||||
favorite_movie="Harry Potter",
|
||||
)
|
||||
course_names = self.dashboard_page.wait_for_page().available_courses
|
||||
self.assertEquals(len(course_names), 1)
|
||||
self.assertEqual(len(course_names), 1)
|
||||
self.assertIn(self.course_info["display_name"], course_names)
|
||||
|
||||
def test_clicking_file_upload_button_without_file_shows_error(self):
|
||||
@@ -617,7 +617,7 @@ class DataDownloadsTest(BaseInstructorDashboardTest):
|
||||
Verifies that a report can be downloaded and an event fired.
|
||||
"""
|
||||
download_links = self.data_download_section.report_download_links
|
||||
self.assertEquals(len(download_links), 1)
|
||||
self.assertEqual(len(download_links), 1)
|
||||
download_links[0].click()
|
||||
expected_url = download_links.attrs('href')[0]
|
||||
self.assertIn(report_name, expected_url)
|
||||
|
||||
@@ -44,7 +44,7 @@ class UnicodeUsernameAdminTest(AcceptanceTest):
|
||||
As a superuser I should be able to update the first name of a user with unicode username.
|
||||
"""
|
||||
self.assertNotEqual(self.page.first_name, 'John')
|
||||
self.assertEquals(self.page.username, self.FIXTURE_USERNAME)
|
||||
self.assertEqual(self.page.username, self.FIXTURE_USERNAME)
|
||||
|
||||
self.page.change_first_name('John')
|
||||
|
||||
@@ -53,4 +53,4 @@ class UnicodeUsernameAdminTest(AcceptanceTest):
|
||||
# Visit the page again to verify changes
|
||||
self.page.visit()
|
||||
|
||||
self.assertEquals(self.page.first_name, 'John', 'The first name should be updated')
|
||||
self.assertEqual(self.page.first_name, 'John', 'The first name should be updated')
|
||||
|
||||
@@ -1285,7 +1285,7 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest):
|
||||
And all sections are expanded
|
||||
"""
|
||||
self.course_outline_page.visit()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
|
||||
self.verify_all_sections(collapsed=False)
|
||||
|
||||
def test_no_expand_link_for_empty_course(self):
|
||||
@@ -1301,7 +1301,7 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest):
|
||||
self.course_outline_page.visit()
|
||||
for section in self.course_outline_page.sections():
|
||||
section.delete()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.MISSING)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.MISSING)
|
||||
self.assertTrue(self.course_outline_page.has_no_content_message)
|
||||
|
||||
def test_collapse_all_when_all_expanded(self):
|
||||
@@ -1316,7 +1316,7 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest):
|
||||
self.course_outline_page.visit()
|
||||
self.verify_all_sections(collapsed=False)
|
||||
self.course_outline_page.toggle_expand_collapse()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
|
||||
self.verify_all_sections(collapsed=True)
|
||||
|
||||
def test_collapse_all_when_some_expanded(self):
|
||||
@@ -1333,7 +1333,7 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest):
|
||||
self.verify_all_sections(collapsed=False)
|
||||
self.course_outline_page.section_at(0).expand_subsection()
|
||||
self.course_outline_page.toggle_expand_collapse()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
|
||||
self.verify_all_sections(collapsed=True)
|
||||
|
||||
def test_expand_all_when_all_collapsed(self):
|
||||
@@ -1347,9 +1347,9 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest):
|
||||
"""
|
||||
self.course_outline_page.visit()
|
||||
self.course_outline_page.toggle_expand_collapse()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
|
||||
self.course_outline_page.toggle_expand_collapse()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
|
||||
self.verify_all_sections(collapsed=False)
|
||||
|
||||
def test_expand_all_when_some_collapsed(self):
|
||||
@@ -1367,11 +1367,11 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest):
|
||||
# if that helps.
|
||||
disable_animations(self.course_outline_page)
|
||||
self.course_outline_page.toggle_expand_collapse()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
|
||||
self.verify_all_sections(collapsed=True)
|
||||
self.course_outline_page.section_at(0).expand_subsection()
|
||||
self.course_outline_page.toggle_expand_collapse()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
|
||||
self.verify_all_sections(collapsed=False)
|
||||
|
||||
|
||||
@@ -1395,7 +1395,7 @@ class ExpandCollapseSingleSectionTest(CourseOutlineTest):
|
||||
"""
|
||||
self.course_outline_page.visit()
|
||||
self.course_outline_page.section_at(0).delete()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.MISSING)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.MISSING)
|
||||
self.assertTrue(self.course_outline_page.has_no_content_message)
|
||||
|
||||
def test_old_subsection_stays_collapsed_after_creation(self):
|
||||
@@ -1435,7 +1435,7 @@ class ExpandCollapseEmptyTest(CourseOutlineTest):
|
||||
Then I do not see the "Collapse All Sections" link
|
||||
"""
|
||||
self.course_outline_page.visit()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.MISSING)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.MISSING)
|
||||
|
||||
def test_link_appears_after_section_creation(self):
|
||||
"""
|
||||
@@ -1447,9 +1447,9 @@ class ExpandCollapseEmptyTest(CourseOutlineTest):
|
||||
And all sections are expanded
|
||||
"""
|
||||
self.course_outline_page.visit()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.MISSING)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.MISSING)
|
||||
self.course_outline_page.add_section_from_top_button()
|
||||
self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
|
||||
self.assertEqual(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
|
||||
self.assertFalse(self.course_outline_page.section_at(0).is_collapsed)
|
||||
|
||||
|
||||
|
||||
@@ -508,7 +508,7 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
|
||||
self.advanced_settings.wait_for_modal_load()
|
||||
self.check_modal_shows_correct_contents(['Course Display Name'])
|
||||
self.advanced_settings.refresh_and_wait_for_load()
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.advanced_settings.get('Course Display Name'),
|
||||
course_display_name,
|
||||
'Wrong input for Course Display Name must not change its value'
|
||||
@@ -530,7 +530,7 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
|
||||
self.check_modal_shows_correct_contents(['Course Display Name'])
|
||||
self.advanced_settings.refresh_and_wait_for_load()
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.advanced_settings.get('Course Display Name'),
|
||||
course_display_name,
|
||||
'Wrong input for Course Display Name must not change its value'
|
||||
@@ -551,7 +551,7 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
|
||||
self.advanced_settings.refresh_and_wait_for_load()
|
||||
|
||||
for key, val in six.iteritems(original_values_map):
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.advanced_settings.get(key),
|
||||
val,
|
||||
'Wrong input for Advanced Settings Fields must not change its value'
|
||||
@@ -574,7 +574,7 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
|
||||
|
||||
# Check that changes are undone
|
||||
for key, val in six.iteritems(original_values_map):
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
self.advanced_settings.get(key),
|
||||
val,
|
||||
'Undoing Should revert back to original value'
|
||||
@@ -600,7 +600,7 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
|
||||
|
||||
# Iterate through the wrong values and make sure they're still displayed
|
||||
for key, val in six.iteritems(inputs):
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
str(self.advanced_settings.get(key)),
|
||||
str(val),
|
||||
'manual change should keep: ' + str(val) + ', but is: ' + str(self.advanced_settings.get(key))
|
||||
@@ -663,7 +663,7 @@ class AdvancedSettingsValidationTest(StudioCourseTest):
|
||||
"""
|
||||
expected_fields = self.advanced_settings.expected_settings_names
|
||||
displayed_fields = self.advanced_settings.displayed_settings_names
|
||||
self.assertEquals(set(displayed_fields), set(expected_fields))
|
||||
self.assertEqual(set(displayed_fields), set(expected_fields))
|
||||
|
||||
|
||||
@attr(shard=16)
|
||||
|
||||
Reference in New Issue
Block a user