8👍
✅
FIXTURE_DIRS is supposed to be a list or tuple, not a string. Remember that it’s the comma that defines a tuple litteral, not the parens, IOW your settings should be
FIXTURE_DIRS = (
os.path.join(PROJECT_DIR, 'dhtmlScheduler\\fixtures\\'),
)
As a side note, hardcoding the path separator kind of defeats the whole point of using os.path.join(), so this should really be:
FIXTURE_DIRS = (
os.path.join(PROJECT_DIR, 'dhtmlScheduler', 'fixtures'),
)
Edit : and finally, you have to declare your TestCase fixtures at the class level, not in the setUp() method…
1👍
FIXTURE_DIRS = (os.path.join(PROJECT_ROOT, 'fixtures'),)
Or
from django.test import TestCase
class MyTestCase(TestCase):
fixtures = [
'/myapp/fixtures/users.json',
'/myapp/fixtures/employee.json'
]
0👍
- [Django]-CSS file not found. Django project
- [Django]-Django SQLite foreign key mismatch error
- [Django]-File does not exist: /var/www/polls
Source:stackexchange.com