added unit test for  RELATED_M2M and patched bug
fixed bug caused by dictionary .values() order