From de3410c73343562b59fc7e6ff34b1579c280203b Mon Sep 17 00:00:00 2001 From: Awais Jibran Date: Mon, 6 Apr 2020 17:04:58 +0500 Subject: [PATCH] Move `attempt.refresh_from_database` call to the tests. --- .../management/commands/tests/test_verify_student.py | 1 - lms/djangoapps/verify_student/tests/__init__.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py b/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py index 72f3090dfd..5cfa3667e6 100644 --- a/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py +++ b/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py @@ -39,7 +39,6 @@ class TestVerifyStudentCommand(MockS3BotoMixin, TestVerificationBase): self.create_upload_and_submit_attempt_for_user() with patch('lms.djangoapps.verify_student.models.requests.post', new=mock_software_secure_post_error): self.create_upload_and_submit_attempt_for_user() - with patch('lms.djangoapps.verify_student.models.requests.post', new=mock_software_secure_post_error): self.create_upload_and_submit_attempt_for_user() # check to make sure we had two successes and two failures; otherwise we've got problems elsewhere diff --git a/lms/djangoapps/verify_student/tests/__init__.py b/lms/djangoapps/verify_student/tests/__init__.py index 5c78fe1a73..e889ad708b 100644 --- a/lms/djangoapps/verify_student/tests/__init__.py +++ b/lms/djangoapps/verify_student/tests/__init__.py @@ -62,6 +62,7 @@ class TestVerificationBase(TestCase): def submit_attempt(self, attempt): with self.immediate_on_commit(): attempt.submit() + attempt.refresh_from_db() return attempt def create_and_submit_attempt_for_user(self, user=None):