Resubmit Photo-Verification button must appear in approval box.

Currently, Resubmit photo-verification button is not been displayed
inside the approval box on dashboard.In order to allow a learner to
resubmit before expire it must be displayed in it.
This commit is contained in:
uzairr
2019-11-14 13:40:00 +05:00
parent a48ec5fdfd
commit 34134ff229
4 changed files with 34 additions and 4 deletions

View File

@@ -9,6 +9,8 @@ import six
from django.conf import settings
from django.test import override_settings
from django.urls import reverse
from django.utils.timezone import now
from mock import patch
from pytz import UTC
@@ -131,6 +133,17 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
response = self.client.get(self.dashboard_url)
self.assertContains(response, attempt.expiration_datetime.strftime("%m/%d/%Y"))
@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())
response = self.client.get(self.dashboard_url)
self.assertContains(response, "Resubmit Verification")
mock_expiry.return_value = False
response = self.client.get(self.dashboard_url)
self.assertNotContains(response, "Resubmit Verification")
def test_missed_verification_deadline(self):
# Expiration date in the past
self._setup_mode_and_enrollment(self.DATES[self.PAST], "verified")
@@ -299,7 +312,7 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
self._assert_course_verification_status(VERIFY_STATUS_APPROVED)
response2 = self.client.get(self.dashboard_url)
self.assertContains(response2, attempt2.expiration_datetime.strftime("%m/%d/%Y"))
self.assertContains(response2, attempt2.expiration_datetime.strftime("%m/%d/%Y"), count=3)
self.assertContains(response2, attempt2.expiration_datetime.strftime("%m/%d/%Y"), count=2)
def _setup_mode_and_enrollment(self, deadline, enrollment_mode):
"""Create a course mode and enrollment.