'Revision.previous should return this revision\'s document\'s
most recent approved revision.'

def test_previous(self):

    rev = revision(is_approved=True, created=datetime(2017, 4, 15, 9, 23), save=True)
    next_rev = revision(document=rev.document, content='Updated', is_approved=True, created=datetime(2017, 4, 15, 9, 24), save=True)
    last_rev = revision(document=rev.document, content='Finally', is_approved=True, created=datetime(2017, 4, 15, 9, 25), save=True)
    trans = Document.objects.create(parent=rev.document, locale='fr', title='In    French')
    trans_rev = revision(document=trans, is_approved=True, based_on=last_rev, created=datetime(2017, 4, 15, 9, 56), save=True)
    assert (rev.previous is None)
    assert (next_rev.previous == rev)
    assert (last_rev.previous == next_rev)
    assert (trans_rev.previous == last_rev)
