This will remove imports from __future__ that are no longer needed. https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
25 lines
644 B
Python
25 lines
644 B
Python
"""
|
|
Factories related to student verification.
|
|
"""
|
|
|
|
|
|
from datetime import timedelta
|
|
|
|
from django.conf import settings
|
|
from django.utils.timezone import now
|
|
from factory.django import DjangoModelFactory
|
|
|
|
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
|
|
|
|
|
|
class SoftwareSecurePhotoVerificationFactory(DjangoModelFactory):
|
|
"""
|
|
Factory for SoftwareSecurePhotoVerification
|
|
"""
|
|
class Meta(object):
|
|
model = SoftwareSecurePhotoVerification
|
|
|
|
status = 'approved'
|
|
if hasattr(settings, 'VERIFY_STUDENT'):
|
|
expiry_date = now() + timedelta(days=settings.VERIFY_STUDENT["DAYS_GOOD_FOR"])
|