'The creator of an answer can edit his/her answer.'

def test_answer_creator_can_edit(self):

    u = UserFactory()
    self.client.login(username=u.username, password='testpass')
    response = get(self.client, 'questions.details', args=[self.question.id])
    doc = pq(response.content)
    eq_(0, len(doc('ol.answers    li.edit')))
    content = 'lorem    ipsum    dolor    sit    amet'
    response = post(self.client, 'questions.reply', {'content': content}, args=[self.question.id])
    doc = pq(response.content)
    eq_(1, len(doc('li.edit')))
    new_answer = self.question.answers.order_by('-id')[0]
    eq_(1, len(doc(('#answer-%s    +    div    li.edit' % new_answer.id))))
    content = 'New    content    for    answer'
    response = post(self.client, 'questions.edit_answer', {'content': content}, args=[self.question.id, new_answer.id])
    eq_(200, response.status_code)
    self.question.is_locked = True
    self.question.save()
    response = post(self.client, 'questions.edit_answer', {'content': content}, args=[self.question.id, new_answer.id])
    eq_(403, response.status_code)
