bpo-35918: Remove broken has_key method and add test (GH-11819) (#11824)

(cherry picked from commit a31f4cc881992e84d351957bd9ac1a92f882fa39)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
3 files changed