committed by
Michael Youngstrom
parent
5e20a0b0bb
commit
99bef9ecfa
@@ -2,9 +2,13 @@
|
||||
Command to delete all rows from the verify_student_historicalverificationdeadline table.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
|
||||
from lms.djangoapps.verify_student.models import VerificationDeadline
|
||||
from openedx.core.djangoapps.util.row_delete import delete_rows, BaseDeletionCommand
|
||||
from openedx.core.djangoapps.util.row_delete import BaseDeletionCommand, delete_rows
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
"""
|
||||
Django admin commands related to verify_student
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import os
|
||||
from pprint import pformat
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from lms.djangoapps.verify_student.models import ManualVerification
|
||||
from lms.djangoapps.verify_student.utils import earliest_allowed_verification_date
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Django admin command to populate expiry_date for approved verifications in SoftwareSecurePhotoVerification
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import time
|
||||
from datetime import timedelta
|
||||
@@ -8,9 +10,9 @@ from datetime import timedelta
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.db.models import F
|
||||
from util.query import use_read_replica_if_available
|
||||
|
||||
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
|
||||
from util.query import use_read_replica_if_available
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Django admin commands related to verify_student
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Django admin command to send verification expiry email to learners
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import time
|
||||
from datetime import timedelta
|
||||
@@ -14,14 +16,14 @@ from django.urls import reverse
|
||||
from django.utils.timezone import now
|
||||
from edx_ace import ace
|
||||
from edx_ace.recipient import Recipient
|
||||
from util.query import use_read_replica_if_available
|
||||
from verify_student.message_types import VerificationExpiry
|
||||
|
||||
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
|
||||
from openedx.core.djangoapps.ace_common.template_context import get_base_template_context
|
||||
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
|
||||
from openedx.core.djangoapps.user_api.preferences.api import get_user_preference
|
||||
from openedx.core.lib.celery.task_utils import emulate_http_request
|
||||
from util.query import use_read_replica_if_available
|
||||
from verify_student.message_types import VerificationExpiry
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -2,16 +2,20 @@
|
||||
Tests for django admin commands in the verify_student module
|
||||
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
from django.core.management import call_command, CommandError
|
||||
import six
|
||||
from django.core.management import CommandError, call_command
|
||||
from django.test import TestCase
|
||||
from testfixtures import LogCapture
|
||||
|
||||
from lms.djangoapps.verify_student.models import ManualVerification
|
||||
from lms.djangoapps.verify_student.utils import earliest_allowed_verification_date
|
||||
from student.tests.factories import UserFactory
|
||||
from testfixtures import LogCapture
|
||||
|
||||
LOGGER_NAME = 'lms.djangoapps.verify_student.management.commands.manual_verifications'
|
||||
|
||||
@@ -27,7 +31,7 @@ class TestVerifyStudentCommand(TestCase):
|
||||
self.user1 = UserFactory.create()
|
||||
self.user2 = UserFactory.create()
|
||||
self.user3 = UserFactory.create()
|
||||
self.invalid_email = unicode('unknown@unknown.com')
|
||||
self.invalid_email = six.text_type('unknown@unknown.com')
|
||||
|
||||
self.create_email_ids_file(
|
||||
self.tmp_file_path,
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Tests for django admin command `populate_expiry_date` in the verify_student module
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
import boto
|
||||
@@ -9,15 +11,12 @@ from django.conf import settings
|
||||
from django.core.management import call_command
|
||||
from django.test import TestCase
|
||||
from mock import patch
|
||||
from student.tests.factories import UserFactory
|
||||
from testfixtures import LogCapture
|
||||
|
||||
from common.test.utils import MockS3Mixin
|
||||
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
|
||||
from lms.djangoapps.verify_student.tests.test_models import (
|
||||
FAKE_SETTINGS,
|
||||
mock_software_secure_post
|
||||
)
|
||||
from lms.djangoapps.verify_student.tests.test_models import FAKE_SETTINGS, mock_software_secure_post
|
||||
from student.tests.factories import UserFactory
|
||||
|
||||
LOGGER_NAME = 'lms.djangoapps.verify_student.management.commands.populate_expiry_date'
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Tests for django admin command `send_verification_expiry_email` in the verify_student module
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
import boto
|
||||
@@ -12,15 +14,12 @@ from django.core.management import call_command
|
||||
from django.test import TestCase
|
||||
from django.utils.timezone import now
|
||||
from mock import patch
|
||||
from student.tests.factories import UserFactory
|
||||
from testfixtures import LogCapture
|
||||
|
||||
from common.test.utils import MockS3Mixin
|
||||
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
|
||||
from lms.djangoapps.verify_student.tests.test_models import (
|
||||
FAKE_SETTINGS,
|
||||
mock_software_secure_post
|
||||
)
|
||||
from lms.djangoapps.verify_student.tests.test_models import FAKE_SETTINGS, mock_software_secure_post
|
||||
from student.tests.factories import UserFactory
|
||||
|
||||
LOGGER_NAME = 'lms.djangoapps.verify_student.management.commands.send_verification_expiry_email'
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ Tests for django admin commands in the verify_student module
|
||||
|
||||
Lots of imports from verify_student's model tests, since they cover similar ground
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import boto
|
||||
from django.conf import settings
|
||||
from django.core.management import call_command
|
||||
|
||||
Reference in New Issue
Block a user