[1.5.x] Fixed #20237 -- Reenabled assertContains with binary parameter

Thanks Baptiste Mispelon for the review.
Backport of fe01404bb9 from master.