Is there a way to load fixtures that do NOT reside in appname/fixtures? According to django docs, fixtures have to be in directory of INSTALLED_APPS
Asked
Active
Viewed 392 times
2 Answers
4
You can define additional locations to search for fixtures using the FIXTURE_DIRS
setting: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS

Mark Lavin
- 24,664
- 5
- 76
- 70
1
Just had to programmatically call 'loaddata' using call_command. You can do it in setUp.
from django.test import TestCase
from django.core.management import call_command
class GlobalSetup(TestCase):
def setUp(self):
# Manually calling loaddata to import fixures
# that are not in INSTALLED_APPS
call_command('loaddata', 'cur_dir/fixtures_name', verbosity=0)

Nam Ngo
- 2,093
- 1
- 23
- 30