gh-37102: fix random doctest failure in generic has_order() function
In this simple patch we fix [a random test failure](https://github.com/s
agemath/sage/actions/runs/7577410381/job/20638145383#step:10:4436) in
the `has_order()` function for generic groups.
#sd123
URL: https://github.com/sagemath/sage/pull/37102
Reported by: Lorenz Panny
Reviewer(s): Travis Scrimshaw