Move attempt.refresh_from_database call to the tests.

This commit is contained in:
Awais Jibran
2020-04-06 17:04:58 +05:00
parent 4ead215665
commit de3410c733
2 changed files with 1 additions and 1 deletions

View File

@@ -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

View File

@@ -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):