'Test that deleted ExtensionVersion are not taken into account when
determining the latest public version.'

def test_latest_public_version_does_not_include_deleted(self):

    extension = Extension.objects.create()
    ExtensionVersion.objects.create(extension=extension, status=STATUS_PUBLIC)
    version = ExtensionVersion.objects.create(extension=extension, status=STATUS_PUBLIC)
    ExtensionVersion.objects.create(extension=extension, status=STATUS_REJECTED)
    ExtensionVersion.objects.create(extension=extension, status=STATUS_OBSOLETE)
    ExtensionVersion.objects.create(extension=extension, status=STATUS_PENDING)
    ExtensionVersion.objects.create(extension=extension, status=STATUS_PUBLIC, deleted=True)
    eq_(extension.latest_public_version, version)
