'Try and vote on `a`. If `ignored` is false, assert the
request worked. If `ignored` is True, assert the request didn\'t
do anything.'

def _check_answer_vote(self, q, a, ignored):

    url = reverse('questions.answer_vote', args=[q.id, a.id], locale='en-US')
    votes = AnswerVote.objects.filter(answer=a).count()
    res = self.client.post(url, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    eq_(res.status_code, 200)
    data = json.loads(res.content)
    eq_(data.get('ignored', False), ignored)
    if ignored:
        eq_(AnswerVote.objects.filter(answer=a).count(), votes)
    else:
        eq_(AnswerVote.objects.filter(answer=a).count(), (votes + 1))
