Merge pull request #21197 from open-craft/giovanni/upgrade-pymongo

BB-1744: Bump pymongo version and fix course export issue
This commit is contained in:
Feanil Patel
2019-12-26 11:16:15 -05:00
committed by GitHub
19 changed files with 75 additions and 70 deletions

View File

@@ -350,4 +350,4 @@ def add_repo(repo, rdir_in, branch=None):
cil.save()
log.debug(u'saved CourseImportLog for %s', cil.course_id)
mdb.disconnect()
mdb.close()

View File

@@ -553,7 +553,7 @@ class GitLogs(TemplateView):
page = min(max(1, given_page), paginator.num_pages)
logs = paginator.page(page)
mdb.disconnect()
mdb.close()
context = {
'logs': logs,
'course_id': text_type(course_id) if course_id else None,

View File

@@ -19,7 +19,7 @@ from testfixtures import LogCapture
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from common.test.utils import MockS3Mixin
from common.test.utils import MockS3Mixin, py2_only
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
from lms.djangoapps.verify_student.tests.test_models import FAKE_SETTINGS, mock_software_secure_post
@@ -206,11 +206,14 @@ class TestSendVerificationExpiryEmail(MockS3Mixin, ModuleStoreTestCase):
self.assertEqual(len(mail.outbox), 1)
self.assertIsNone(attempt.expiry_email_date)
@py2_only
def test_user_enrolled_in_verified_course(self):
"""
Test that if the user is enrolled in verified track, then after sending the default no of
emails, `expiry_email_date` is updated to now() so that it's filtered in the future to send
email again
email again.
Does not work on python 3 with the latest mongo driver version due to class inheritance issues.
"""
user = UserFactory.create()
course = CourseFactory()

View File

@@ -23,7 +23,7 @@ FAKE_SETTINGS = {
@patch.dict(settings.VERIFY_STUDENT, FAKE_SETTINGS)
@ddt.ddt
class TestIDVerificationService(MockS3Mixin, ModuleStoreTestCase):
class TestIDVerificationService(ModuleStoreTestCase, MockS3Mixin):
"""
Tests for IDVerificationService.
"""