'Test marking solve/unsolve with \'change_solution\' permission.'

def test_solve_unsolve_with_perm(self):

    u = UserFactory()
    add_permission(u, Question, 'change_solution')
    self.client.login(username=u.username, password='testpass')
    ans = self.question.answers.all()[0]
    post(self.client, 'questions.solve', args=[self.question.id, ans.id])
    q = Question.objects.get(pk=self.question.id)
    eq_(q.solution, ans)
    eq_(q.solver, u)
    post(self.client, 'questions.unsolve', args=[self.question.id, ans.id])
    q = Question.objects.get(pk=self.question.id)
    eq_(q.solution, None)
    eq_(q.solver, None)
