Commit 410cc166 by Tyler Hallada

Fix python unit tests

parent 01a4f9af
...@@ -18,7 +18,7 @@ from django.test.client import RequestFactory ...@@ -18,7 +18,7 @@ from django.test.client import RequestFactory
from django.test.utils import override_settings from django.test.utils import override_settings
from edx_proctoring.api import create_exam, create_exam_attempt, update_attempt_status from edx_proctoring.api import create_exam, create_exam_attempt, update_attempt_status
from edx_proctoring.runtime import set_runtime_service from edx_proctoring.runtime import set_runtime_service
from edx_proctoring.tests.test_services import MockCreditService from edx_proctoring.tests.test_services import MockCreditService, MockGradesService
from freezegun import freeze_time from freezegun import freeze_time
from milestones.tests.utils import MilestonesTestCaseMixin from milestones.tests.utils import MilestonesTestCaseMixin
from mock import MagicMock, Mock, patch from mock import MagicMock, Mock, patch
...@@ -995,6 +995,11 @@ class TestProctoringRendering(SharedModuleStoreTestCase): ...@@ -995,6 +995,11 @@ class TestProctoringRendering(SharedModuleStoreTestCase):
MockCreditService(enrollment_mode=enrollment_mode) MockCreditService(enrollment_mode=enrollment_mode)
) )
set_runtime_service(
'grades',
MockGradesService()
)
exam_id = create_exam( exam_id = create_exam(
course_id=unicode(self.course_key), course_id=unicode(self.course_key),
content_id=unicode(sequence.location), content_id=unicode(sequence.location),
......
...@@ -36,6 +36,8 @@ class SubsectionGradeBase(object): ...@@ -36,6 +36,8 @@ class SubsectionGradeBase(object):
self.graded_total = None # aggregated grade for all graded problems self.graded_total = None # aggregated grade for all graded problems
self.all_total = None # aggregated grade for all problems, regardless of whether they are graded self.all_total = None # aggregated grade for all problems, regardless of whether they are graded
self.override = None
@property @property
def attempted(self): def attempted(self):
""" """
...@@ -108,7 +110,6 @@ class SubsectionGrade(SubsectionGradeBase): ...@@ -108,7 +110,6 @@ class SubsectionGrade(SubsectionGradeBase):
self._compute_block_score(descendant_key, course_structure, submissions_scores, csm_scores) self._compute_block_score(descendant_key, course_structure, submissions_scores, csm_scores)
self.all_total, self.graded_total = graders.aggregate_scores(self.problem_scores.values()) self.all_total, self.graded_total = graders.aggregate_scores(self.problem_scores.values())
self.override = None
self._log_event(log.debug, u"init_from_structure", student) self._log_event(log.debug, u"init_from_structure", student)
return self return self
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment