'Hot-patch the grading emission system to capture grading events.'

def setUp(self):

    super(GradePublishTestMixin, self).setUp()
    def capture_score(user_id, usage_key, score, max_score):
        "\n                                                Hot-patch    which    stores    scores    in    a    local    array    instead    of    the\n                                                database.\n\n                                                Note    that    to    make    this    generic,    we'd    need    to    do    both.\n                                                "
        self.scores.append({'student': user_id, 'usage': usage_key, 'score': score, 'max_score': max_score})
        return (datetime.now().replace(tzinfo=pytz.UTC) - timedelta(hours=1))
    self.scores = []
    patcher = mock.patch('lms.djangoapps.grades.signals.handlers.set_score', capture_score)
    patcher.start()
    self.addCleanup(patcher.stop)
