'Check that the most upvoted hint is shown'

def test_show_best_hint(self):

    self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'})
    submission1 = {'new_hint_submission': 'new    hint    for    answer    1', 'answer': 'incorrect    answer    1'}
    submission2 = {'new_hint_submission': 'new    hint    for    answer    1    to    report', 'answer': 'incorrect    answer    1'}
    self.call_event('add_new_hint', submission1)
    self.call_event('add_new_hint', submission2)
    data_upvote = {'student_answer': 'incorrect    answer    1', 'hint': 'new    hint    for    answer    1    to    report', 'student_rating': 'upvote'}
    self.call_event('rate_hint', data_upvote)
    data_downvote = {'student_answer': 'incorrect    answer    1', 'hint': 'new    hint    for    answer    1    to    report', 'student_rating': 'report'}
    self.call_event('rate_hint', data_downvote)
    result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'})
    expected = {'BestHint': 'new    hint    for    answer    1', 'StudentAnswer': 'incorrect    answer    1', 'HintCategory': 'ErrorResponse'}
    self.assertEqual(json.loads(result.content), expected)
