def METHOD_NAME(self):
    pkg = model.Package.by_name(self.pkgname)
    all_resources = model.Session.query(model.Resource)
    active_resources = model.Session.query(model.Resource).filter_by(
        state=model.State.ACTIVE
    )
    assert all_resources.count() == 3, all_resources.all()
    assert active_resources.count() == 3, active_resources.count()
    pkg.delete()
    model.repo.commit_and_remove()
    pkg = model.Package.by_name(self.pkgname)
    # OK for resources remain active
    assert all_resources.count() == 3, all_resources.all()
    assert active_resources.count() == 3, active_resources.count()