chore: install codejail from pypi (#29481)
* chore: install codejail from pypi * chore: Updating Python Requirements * chore: Updating Python Requirements * fix: fixed failing tests * fix: fixed pytest failures * fix: fixed failing test bug * Update mocks.py Co-authored-by: edX requirements bot <testeng+edx-requirements-bot@edx.org>
This commit is contained in:
committed by
GitHub
parent
00b53287d5
commit
21551095ac
@@ -605,7 +605,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
|
||||
enrollment = CourseEnrollmentFactory(course_id=self.course.id)
|
||||
student = enrollment.user
|
||||
outbox = self.get_outbox()
|
||||
assert outbox == []
|
||||
assert not outbox
|
||||
|
||||
url = reverse(
|
||||
view_name,
|
||||
@@ -687,7 +687,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
|
||||
enrollment = CourseEnrollmentFactory(course_id=course_key)
|
||||
student = enrollment.user
|
||||
outbox = self.get_outbox()
|
||||
assert outbox == []
|
||||
assert not outbox
|
||||
|
||||
url = reverse(
|
||||
view_name,
|
||||
@@ -729,7 +729,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
|
||||
ccx = self.make_ccx()
|
||||
course_key = CCXLocator.from_course_locator(self.course.id, ccx.id)
|
||||
outbox = self.get_outbox()
|
||||
assert outbox == []
|
||||
assert not outbox
|
||||
|
||||
url = reverse(
|
||||
view_name,
|
||||
@@ -777,7 +777,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase):
|
||||
course_key = CCXLocator.from_course_locator(course.id, ccx.id)
|
||||
outbox = self.get_outbox()
|
||||
CourseEnrollmentAllowed(course_id=course_key, email=identifier)
|
||||
assert outbox == []
|
||||
assert not outbox
|
||||
|
||||
url = reverse(
|
||||
view_name,
|
||||
|
||||
@@ -515,7 +515,7 @@ class CertificateGetTests(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Test the case when there are no certificates for a user.
|
||||
"""
|
||||
assert get_certificates_for_user(self.student_no_cert.username) == []
|
||||
assert not get_certificates_for_user(self.student_no_cert.username)
|
||||
|
||||
@patch.dict(settings.FEATURES, {'CERTIFICATES_HTML_VIEW': True})
|
||||
def test_get_web_certificate_url(self):
|
||||
|
||||
@@ -79,7 +79,7 @@ class mock_ecommerce_api_endpoint:
|
||||
if self.expect_called is None:
|
||||
called_if_expected = True
|
||||
else:
|
||||
called_if_expected = self.expect_called == (httpretty.last_request().headers != {})
|
||||
called_if_expected = self.expect_called == (bool(httpretty.last_request().headers))
|
||||
httpretty.disable()
|
||||
|
||||
if self.reset_on_exit:
|
||||
|
||||
@@ -139,7 +139,7 @@ class CoursesTest(ModuleStoreTestCase):
|
||||
|
||||
# Request filtering for an org distinct from the designated org.
|
||||
no_courses = get_courses(user, org=primary)
|
||||
assert list(no_courses) == []
|
||||
assert not list(no_courses)
|
||||
|
||||
# Request filtering for an org matching the designated org.
|
||||
site_courses = get_courses(user, org=alternate)
|
||||
|
||||
@@ -63,7 +63,7 @@ class ExperimentUtilsTests(ModuleStoreTestCase, TestCase):
|
||||
|
||||
def test_unenrolled_courses_for_empty_courses(self):
|
||||
unenrolled_courses = get_unenrolled_courses([], [])
|
||||
assert [] == unenrolled_courses
|
||||
assert not unenrolled_courses
|
||||
|
||||
def test_unenrolled_courses_for_single_course(self):
|
||||
course = {'key': 'UQx+ENGY1x'}
|
||||
|
||||
@@ -279,7 +279,7 @@ class TestGradeIteration(SharedModuleStoreTestCase):
|
||||
iterator, but it shouldn't error.
|
||||
"""
|
||||
grade_results = list(CourseGradeFactory().iter([], self.course))
|
||||
assert grade_results == []
|
||||
assert not grade_results
|
||||
|
||||
def test_all_empty_grades(self):
|
||||
"""
|
||||
|
||||
@@ -70,8 +70,8 @@ class TestAnalyticsFormatDictlist(TestCase):
|
||||
|
||||
def test_format_dictlist_empty(self):
|
||||
header, datarows = format_dictlist([], [])
|
||||
assert header == []
|
||||
assert datarows == []
|
||||
assert not header
|
||||
assert not datarows
|
||||
|
||||
def test_create_csv_response(self):
|
||||
header = ['Name', 'Email']
|
||||
|
||||
@@ -314,7 +314,7 @@ class TestLinkProgramEnrollments(TestLinkProgramEnrollmentsMixin, TestCase):
|
||||
}
|
||||
)
|
||||
|
||||
assert errors == {}
|
||||
assert not errors
|
||||
self._assert_program_enrollment(self.user_2, self.program, '0001')
|
||||
self._assert_no_program_enrollment(self.user_1, self.program)
|
||||
# assert that all of user_1's course enrollments as part of the program
|
||||
|
||||
@@ -906,7 +906,7 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin, Tes
|
||||
# ensure the mock api call was made. NOTE: the following line
|
||||
# approximates the check - if the headers were empty it means
|
||||
# there was no last request.
|
||||
assert httpretty.last_request().headers != {}
|
||||
assert httpretty.last_request().headers
|
||||
return response
|
||||
|
||||
def _assert_displayed_mode(self, response, expected_mode):
|
||||
|
||||
Reference in New Issue
Block a user