Fixes #18896. Add tests verifying that you can get IntegrityErrors using get_or_create through relations like M2M, and it also adds a note into the documentation warning about it
Merge pull request #1164 from pyriku/get_or_create_through_m2m

Integrity problems when using get_or_create through M2M