refactor: pyupgrade second iteration (#27442)

This commit is contained in:
Usama Sadiq
2021-05-03 17:13:15 +05:00
committed by GitHub
parent 11ec4a9aaa
commit 60f49d4048
14 changed files with 27 additions and 27 deletions

View File

@@ -187,11 +187,11 @@ class TestGetCourseListMultipleCourses(CourseListTestMixin, ModuleStoreTestCase)
# No filtering.
unfiltered_courses = self._make_api_call(self.staff_user, self.staff_user)
for org in [self.course.org, alternate_course.org]:
assert any(((course.org == org) for course in unfiltered_courses))
assert any((course.org == org) for course in unfiltered_courses)
# With filtering.
filtered_courses = self._make_api_call(self.staff_user, self.staff_user, org=self.course.org)
assert all(((course.org == self.course.org) for course in filtered_courses))
assert all((course.org == self.course.org) for course in filtered_courses)
def test_filter(self):
# Create a second course to be filtered out of queries.

View File

@@ -177,11 +177,11 @@ class CourseListViewTestCaseMultipleCourses(CourseApiTestViewMixin, ModuleStoreT
# No filtering.
unfiltered_response = self.verify_response(params={'username': self.staff_user.username})
for org in [self.course.org, alternate_course.org]:
assert any(((course['org'] == org) for course in unfiltered_response.data['results']))
assert any((course['org'] == org) for course in unfiltered_response.data['results'])
# With filtering.
filtered_response = self.verify_response(params={'org': self.course.org, 'username': self.staff_user.username})
assert all(((course['org'] == self.course.org) for course in filtered_response.data['results']))
assert all((course['org'] == self.course.org) for course in filtered_response.data['results'])
def test_filter(self):
self.setup_user(self.staff_user)