3👍
✅
Import the TestCase from django.test
;
- Not:
import unittest
- Not:
import django.utils.unittest
- But:
import django.test
Like this:
from django.test import TestCase
class test_something(TestCase):
fixtures = ['one.json', 'two.json']
...
https://docs.djangoproject.com/en/1.3/topics/testing/#django.test.TestCase
0👍
You don’t pass the full path to the fixture, just the fixture name:
fixtures = ['fixture_questions.json']
As long as the fixture is in a fixtures
directory within an app that’s in INSTALLED_APPS, Django will find it.
- [Django]-Django: can't bind an uploaded image to a form ImageField()
- [Django]-How to compare Referer URL in Django Request to another URL using reverse()?
- [Django]-Generic view 'archive_year' produces blank page
Source:stackexchange.com