'Make sure deleting the latest localizable revision doesn\'t delete
the document but instead sets its latest localizable revision to the
previous one.
Making sure current_revision does the same is covered in the
test_delete_current_revision template test.'

def test_delete(self):

    r1 = ApprovedRevisionFactory(is_ready_for_localization=True)
    d = r1.document
    r2 = ApprovedRevisionFactory(document=d, is_ready_for_localization=True)
    r2.delete()
    eq_(r1, Document.objects.get(pk=d.pk).latest_localizable_revision)
    r1.delete()
    eq_(None, Document.objects.get(pk=d.pk).latest_localizable_revision)
