I believe I was not clear.

I do use migrations to populate Enums and other data that should also be 
available in production.

The code I am sending is to load fixtures on the database.

This way all tests can assume the same set of data and we all the fixtures 
are loaded in one place, which in my case of use it makes sense.

The advantage of the method I am proposing is that it is quite fast. Data 
is loaded only once in the DB and that it is duplicated in bulk mode by the 
DBMS, as many times as necessary when tests run in parallel. 

Another unexpected convenience of my method is that a developer who uses 
Django to populate fixtures in the database, does not have to worry if 
his/her code to generate data has side effects or not if he is running 
tests in parallel, because his data generation code will run only once.


Actually, if I may ask, how else would one load bunches of fixtures in the 
DB and run tests in parallel without my PR ?


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/32df6bec-a2ce-494e-b007-5f4433ad682f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to