'Mocks the scores needed by the SCORE_PUBLISHED signal
handler. By default, sets the returned score to 1/2.'

@contextmanager
def mock_get_score(self, score=MagicMock(grade=1.0, max_grade=2.0)):

    with patch('lms.djangoapps.grades.tasks.get_score', return_value=score):
        (yield)
