Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions cms/djangoapps/contentstore/tests/test_exams.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from cms.djangoapps.contentstore.signals.handlers import listen_for_course_publish
from openedx.core.djangoapps.course_apps.toggles import EXAMS_IDA
from xmodule.modulestore.tests.django_utils import TEST_DATA_MONGO_AMNESTY_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory


Expand All @@ -23,7 +23,7 @@ class TestExamService(ModuleStoreTestCase):
"""
Test for syncing exams to the exam service
"""
MODULESTORE = TEST_DATA_MONGO_AMNESTY_MODULESTORE
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE

def setUp(self):
"""
Expand Down Expand Up @@ -68,6 +68,7 @@ def test_publishing_exam(self, is_proctored_exam, is_practice_exam,
When a course is published it will register all exams sections with the exams service
"""
default_time_limit_minutes = 10
due_date = datetime.now(UTC) + timedelta(minutes=default_time_limit_minutes + 1)

sequence = ItemFactory.create(
parent=self.chapter,
Expand All @@ -76,9 +77,9 @@ def test_publishing_exam(self, is_proctored_exam, is_practice_exam,
graded=True,
is_time_limited=True,
default_time_limit_minutes=default_time_limit_minutes,
is_proctored_exam=is_proctored_exam,
is_proctored_enabled=is_proctored_exam,
is_practice_exam=is_practice_exam,
due=datetime.now(UTC) + timedelta(minutes=default_time_limit_minutes + 1),
due=due_date,
hide_after_due=True,
is_onboarding_exam=is_onboarding_exam,
)
Expand All @@ -88,7 +89,7 @@ def test_publishing_exam(self, is_proctored_exam, is_practice_exam,
'content_id': str(sequence.location),
'exam_name': sequence.display_name,
'time_limit_mins': sequence.default_time_limit_minutes,
'due_date': sequence.due,
'due_date': due_date,
'exam_type': expected_type,
'is_active': True,
'hide_after_due': True,
Expand Down Expand Up @@ -117,7 +118,7 @@ def test_dangling_exam(self, mock_patch_course_exams):
graded=True,
is_time_limited=True,
default_time_limit_minutes=10,
is_proctored_exam=True,
is_proctored_enabled=True,
hide_after_due=False,
)
self.store.delete_item(self.chapter.location, self.user.id)
Expand All @@ -137,7 +138,7 @@ def test_feature_flag_off(self, mock_patch_course_exams):
graded=True,
is_time_limited=True,
default_time_limit_minutes=10,
is_proctored_exam=True,
is_proctored_enabled=True,
hide_after_due=False,
)

Expand All @@ -154,7 +155,7 @@ def test_self_paced_no_due_dates(self, mock_patch_course_exams):
graded=True,
is_time_limited=True,
default_time_limit_minutes=60,
is_proctored_exam=False,
is_proctored_enabled=False,
is_practice_exam=False,
due=datetime.now(UTC) + timedelta(minutes=60),
hide_after_due=True,
Expand Down
22 changes: 11 additions & 11 deletions cms/djangoapps/contentstore/tests/test_proctoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from edx_proctoring.api import get_all_exams_for_course, get_review_policy_by_exam_id
from pytz import UTC
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import TEST_DATA_MONGO_AMNESTY_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory

from cms.djangoapps.contentstore.signals.handlers import listen_for_course_publish
Expand All @@ -24,7 +24,7 @@ class TestProctoredExams(ModuleStoreTestCase):
"""
Tests for the publishing of proctored exams
"""
MODULESTORE = TEST_DATA_MONGO_AMNESTY_MODULESTORE
MODULESTORE = TEST_DATA_SPLIT_MODULESTORE

def setUp(self):
"""
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_onboarding_exam_is_practice_exam(self, is_practice_exam, is_onboarding_
graded=True,
is_time_limited=True,
default_time_limit_minutes=default_time_limit_minutes,
is_proctored_exam=is_proctored_exam,
is_proctored_enabled=is_proctored_exam,
is_practice_exam=is_practice_exam,
due=datetime.now(UTC) + timedelta(minutes=default_time_limit_minutes + 1),
exam_review_rules="allow_use_of_paper",
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_publishing_exam(self, is_proctored_exam,
graded=True,
is_time_limited=True,
default_time_limit_minutes=default_time_limit_minutes,
is_proctored_exam=is_proctored_exam,
is_proctored_enabled=is_proctored_exam,
is_practice_exam=is_practice_exam,
due=datetime.now(UTC) + timedelta(minutes=default_time_limit_minutes + 1),
exam_review_rules="allow_use_of_paper",
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_unpublishing_proctored_exam(self):
graded=True,
is_time_limited=True,
default_time_limit_minutes=10,
is_proctored_exam=True,
is_proctored_enabled=True,
hide_after_due=False,
is_onboarding_exam=False,
)
Expand Down Expand Up @@ -196,7 +196,7 @@ def test_dangling_exam(self):
graded=True,
is_time_limited=True,
default_time_limit_minutes=10,
is_proctored_exam=True,
is_proctored_enabled=True,
hide_after_due=False,
)

Expand Down Expand Up @@ -231,7 +231,7 @@ def test_feature_flag_off(self):
graded=True,
is_time_limited=True,
default_time_limit_minutes=10,
is_proctored_exam=True,
is_proctored_enabled=True,
hide_after_due=False,
)

Expand Down Expand Up @@ -267,7 +267,7 @@ def test_advanced_settings(self, enable_timed_exams, enable_proctored_exams, exp
graded=True,
is_time_limited=True,
default_time_limit_minutes=10,
is_proctored_exam=True,
is_proctored_enabled=True,
exam_review_rules="allow_use_of_paper",
hide_after_due=False,
)
Expand Down Expand Up @@ -296,7 +296,7 @@ def test_self_paced_no_due_dates(self):
graded=True,
is_time_limited=True,
default_time_limit_minutes=60,
is_proctored_exam=False,
is_proctored_enabled=False,
is_practice_exam=False,
due=datetime.now(UTC) + timedelta(minutes=60),
exam_review_rules="allow_use_of_paper",
Expand Down Expand Up @@ -325,7 +325,7 @@ def test_async_waffle_flag_publishes(self):
graded=True,
is_time_limited=True,
default_time_limit_minutes=10,
is_proctored_exam=True,
is_proctored_enabled=True,
hide_after_due=False,
is_onboarding_exam=False,
exam_review_rules="allow_use_of_paper",
Expand All @@ -346,7 +346,7 @@ def test_async_waffle_flag_task(self):
graded=True,
is_time_limited=True,
default_time_limit_minutes=10,
is_proctored_exam=True,
is_proctored_enabled=True,
hide_after_due=False,
is_onboarding_exam=False,
exam_review_rules="allow_use_of_paper",
Expand Down