[1.7.x] Fixed broken test from da160d440f; refs #23418.

Backport of 16548cfc7c from master