Saving a model instance without CharField primary key does not raise IntegrityError
|Reported by:||Pam||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a model with a CharField as primary key. I then write a unit test where I'm not inserting the primary key but other required fields. I save the instance with force_insert=True (I'm using Django 1.0.2). Django saves this as blank string "" and not raising IntegrityError. I even tried adding Blank=False, but still gets the same result. Is this an expected behavior?