[1.7.x] Cleaned up and reformatted autodetector tests
[1.7.x] Cleaned up and reformatted autodetector tests

Backport of 233165083593baf5f62194f50df26fb830e5f570 from master.

jyotsna1820/django,oscaro/django,jyotsna1820/django,jyotsna1820/django,oscaro/django,oscaro/django,jyotsna1820/django,oscaro/django