'If there is only one revision, it can\'t be deleted.'

def test_delete_only_revision(self):

    u = UserFactory()
    add_permission(u, Revision, 'delete_revision')
    self.client.login(username=u.username, password='testpass')
    doc = DocumentFactory()
    rev = RevisionFactory(document=doc)
    response = get(self.client, 'wiki.delete_revision', args=[doc.slug, rev.id])
    eq_(200, response.status_code)
    eq_('Unable    to    delete    only    revision    of    the    document', pq(response.content)('h1.title').text())
    response = post(self.client, 'wiki.delete_revision', args=[doc.slug, rev.id])
    eq_(400, response.status_code)
    Revision.objects.get(id=rev.id)
