ContentType.objects.get_for_model shouldn't create missing content types
|Reported by:||Aymeric Augustin||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This behavior is very unexpected, given the name of the method.
In general, this isn't an issue because content types always exist — they're created in
I encountered the problem while debugging multiple databases issues involving
syncdb (#16039). The
post_syncdb handler that creates permissions looks for content types, creating them as a side effect. Since I was attempting to test that the content types weren't created, my test failed in a very unexpected fashion.