'Deleting the current_revision of a document should update
the current_revision to previous version.'

def test_delete_current_revision(self):

    doc = DocumentFactory()
    rev1 = ApprovedRevisionFactory(document=doc)
    rev2 = ApprovedRevisionFactory(document=doc)
    u = UserFactory()
    add_permission(u, Revision, 'delete_revision')
    self.client.login(username=u.username, password='testpass')
    eq_(rev2, doc.current_revision)
    res = post(self.client, 'wiki.delete_revision', args=[doc.slug, rev2.id])
    eq_(res.status_code, 200)
    doc = Document.objects.get(pk=doc.pk)
    eq_(rev1, doc.current_revision)
