We are setting primary key unconditionally here which was leading to many test failures (and is an actual issue).
We have overcame this issue for passing different tests by commenting the code but we need to make the proper fix
For a model definition where Django would normally think that the default is NOT_PROVIDED, we set a different default. That again causes Django to behave differently here
If the pk.default had been NOT_PROVIDED (as Django expects when a normal generated primary key is being used), then force_insert=True had not been set
We are setting primary key unconditionally here which was leading to many test failures (and is an actual issue). We have overcame this issue for passing different tests by commenting the code but we need to make the proper fix
For a model definition where Django would normally think that the default is NOT_PROVIDED, we set a different default. That again causes Django to behave differently here If the pk.default had been NOT_PROVIDED (as Django expects when a normal generated primary key is being used), then force_insert=True had not been set
Please see more details here https://code.djangoproject.com/ticket/33052.