[1.7.x] Added a unit test to ensure models cannot be ordered by a M2M field.
[1.7.x] Added a unit test to ensure models cannot be ordered by a M2M field.

Backport of 865bc71783 from master

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