'Helper function to ensure that the mocked event tracker
was called with the expected info based on the passed grade.'

def _assert_tracker_emitted_event(self, tracker_mock, grade):

    tracker_mock.emit.assert_called_with(u'edx.grades.course.grade_calculated', {'user_id': unicode(grade.user_id), 'course_id': unicode(grade.course_id), 'course_version': unicode(grade.course_version), 'percent_grade': grade.percent_grade, 'letter_grade': unicode(grade.letter_grade), 'course_edited_timestamp': unicode(grade.course_edited_timestamp), 'event_transaction_id': unicode(get_event_transaction_id()), 'event_transaction_type': unicode(get_event_transaction_type()), 'grading_policy_hash': unicode(grade.grading_policy_hash)})
