سؤال

In django fixtures dirs, I have the file initial_data.json with some data for database.

in some test, I need a empty database, but when I make

python manage.py test 

the initial_data files are loaded.

How I can ignore the initial_data.json in test ?

هل كانت مفيدة؟

المحلول

Why not rename them to not be called initial_data to avoid the auto-loading during tests and then only load them manually in your dev process when required using ./manage.py loaddata ?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top