1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import os
from django.core import management
from django.conf import settings
def load_global_fixtures(*fixtures, **opts):
options = dict(fixtures_root=settings.FIXTURES_ROOT, verbosity=0)
options.update(opts)
for fixture in fixtures:
management.call_command('loaddata',
os.path.join(options['fixtures_root'], fixture),
verbosity=options['verbosity'])
|
More like this
- manage.py with magic python path by bikeshedder 5 years, 11 months ago
- Unit Tests That Write Fixtures by justquick 4 years, 3 months ago
- staticview for app by limodou 5 years, 11 months ago
- testdata tag for templates by showell 4 years ago
- Setting distinction between development and public server by Archatas 6 years, 2 months ago
Comments