Merge pull request #25500 from edx/bseverino/idv-expiration

Set expiration_date field in IDVerificationAttempt model
This commit is contained in:
Bianca Severino
2020-11-10 13:08:41 -05:00
committed by GitHub
19 changed files with 370 additions and 148 deletions

View File

@@ -136,7 +136,11 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
@patch("lms.djangoapps.verify_student.services.is_verification_expiring_soon")
def test_verify_resubmit_button_on_dashboard(self, mock_expiry):
mock_expiry.return_value = True
SoftwareSecurePhotoVerification.objects.create(user=self.user, status='approved', expiry_date=now())
SoftwareSecurePhotoVerification.objects.create(
user=self.user,
status='approved',
expiration_date=now() + timedelta(days=1)
)
response = self.client.get(self.dashboard_url)
self.assertContains(response, "Resubmit Verification")
@@ -162,7 +166,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
attempt.mark_ready()
attempt.submit()
attempt.approve()
attempt.created_at = self.DATES[self.PAST] - timedelta(days=900)
attempt.expiration_date = self.DATES[self.PAST] - timedelta(days=900)
attempt.save()
# The student didn't have an approved verification at the deadline,
@@ -178,7 +182,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
attempt.mark_ready()
attempt.submit()
attempt.approve()
attempt.created_at = self.DATES[self.PAST] - timedelta(days=900)
attempt.expiration_date = self.DATES[self.PAST] - timedelta(days=900)
attempt.save()
# The student didn't have an approved verification at the deadline,