'Test that when a Extension instance is hard-deleted, the
ExtensionVersion referencing it are also hard-deleted, as well as the
attached files.'

def test_hard_delete_with_file(self):

    extension = Extension.objects.create()
    version = ExtensionVersion.objects.create(extension=extension, version='0.1')
    (file_path, signed_file_path) = self._create_files_for_version(version)
    extension.delete(hard_delete=True)
    assert (not Extension.objects.count())
    assert (not ExtensionVersion.objects.count())
    assert (not private_storage.exists(file_path))
    assert (not public_storage.exists(signed_file_path))
