gregmuellegger / django-autofixture

Can create auto-generated test data.
BSD 3-Clause "New" or "Revised" License
460 stars 118 forks source link

`post_process_instance` and instance saving order. Also bug with `UserFixture`. #29

Closed AndreiPashkin closed 10 years ago

AndreiPashkin commented 10 years ago

Current implementation of post_process_instance implies that user, that would override it must save manually modified instance inside method of child class. But actually Im not sure - is it really intended by author to be as that. Old documentation documentation says that this method should return "modified instance" in "last possible moment" which might mean moment before saving. post_process_instance in UserFixture illustrates what Im talking about, take a look, with this implementation any modifications done by post_process_instance will be lost during creation, including password, because instance not being saved.

gregmuellegger commented 10 years ago

I hope to addressed this issue in your interest. I clarified the docs and made the UserFixture.post_process_instance work as advertised.