[1.7.x] Formatted model states in autodetector tests

Backport of f17acd59303a27876966927869af7f4bfe38a74a from master.
[1.7.x] Cleaned up and reformatted autodetector tests

Backport of 233165083593baf5f62194f50df26fb830e5f570 from master.