Skip to content

Commit

Permalink
feat: rename setting for pearson vue engine use
Browse files Browse the repository at this point in the history
  • Loading branch information
johanseto committed Sep 4, 2024
1 parent 609622d commit f72c455
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions eox_nelp/signals/receivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def pearson_vue_course_completion_handler(instance, **kwargs): # pylint: disabl
)

if getattr(settings, "USE_PEARSON_ENGINE_SERVICE", False):
if not getattr(settings, "PEARSON_RTI_COURSES_DATA", {}).get(str(instance.context_key)):
if not getattr(settings, "PEARSON_ENGINE_COURSES_ENABLED", {}).get(str(instance.context_key)):
return
real_time_import_task_v2.delay(
user_id=instance.user_id,
Expand Down Expand Up @@ -441,7 +441,7 @@ def pearson_vue_course_passed_handler(user, course_id, **kwargs): # pylint: dis
)

if getattr(settings, "USE_PEARSON_ENGINE_SERVICE", False):
if not getattr(settings, "PEARSON_RTI_COURSES_DATA", {}).get(str(course_id)):
if not getattr(settings, "PEARSON_ENGINE_COURSES_ENABLED", {}).get(str(course_id)):
return
real_time_import_task_v2.delay(
user_id=user.id,
Expand Down
14 changes: 4 additions & 10 deletions eox_nelp/signals/tests/test_receivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,7 @@ def test_invalid_course_state(self, invalid_state, task_mock, get_completed_and_

task_mock.delay.assert_not_called()

@override_settings(
PEARSON_RTI_ACTIVATE_COMPLETION_GATE=True,
PEARSON_RTI_COURSES_DATA=course_exam_configuration,
)
@override_settings(PEARSON_RTI_ACTIVATE_COMPLETION_GATE=True, PEARSON_RTI_COURSES_DATA=course_exam_configuration,)
@patch("eox_nelp.signals.receivers.get_completed_and_graded")
@patch("eox_nelp.signals.receivers.real_time_import_task")
def test_call_async_task(self, task_mock, get_completed_and_graded_mock):
Expand All @@ -796,7 +793,7 @@ def test_call_async_task(self, task_mock, get_completed_and_graded_mock):
@override_settings(
PEARSON_RTI_ACTIVATE_COMPLETION_GATE=True,
USE_PEARSON_ENGINE_SERVICE=True,
PEARSON_RTI_COURSES_DATA=course_exam_configuration,
PEARSON_ENGINE_COURSES_ENABLED=course_exam_configuration,
)
@patch("eox_nelp.signals.receivers.get_completed_and_graded")
@patch("eox_nelp.signals.receivers.real_time_import_task_v2")
Expand Down Expand Up @@ -858,10 +855,7 @@ def test_invalid_course_configuration(self, wrong_course_config, task_mock):

task_mock.delay.assert_not_called()

@override_settings(
PEARSON_RTI_ACTIVATE_GRADED_GATE=True,
PEARSON_RTI_COURSES_DATA=course_exam_configuration,
)
@override_settings(PEARSON_RTI_ACTIVATE_GRADED_GATE=True, PEARSON_RTI_COURSES_DATA=course_exam_configuration,)
@patch("eox_nelp.signals.receivers.real_time_import_task")
def test_call_async_task(self, task_mock):
"""Test that the async task is called with the right parameters
Expand All @@ -881,7 +875,7 @@ def test_call_async_task(self, task_mock):
@override_settings(
PEARSON_RTI_ACTIVATE_GRADED_GATE=True,
USE_PEARSON_ENGINE_SERVICE=True,
PEARSON_RTI_COURSES_DATA=course_exam_configuration,
PEARSON_ENGINE_COURSES_ENABLED=course_exam_configuration,
)
@patch("eox_nelp.signals.receivers.real_time_import_task_v2")
def test_call_async_task_v2(self, task_mock):
Expand Down

0 comments on commit f72c455

Please sign in to comment.