Making test more DRY. See #2862