Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 1.4 says "No database fixture specified. Please provide the path of at least one fixture in the command line."

while all tests complete without errors and fixtures are actually loaded. Is it Django 1.4 issue?

Please note that only some of the applications provoke this error message (there is no conceptual difference between the applications' unit tests and their corresponding fixtures).

Update 1: the fasttest.py content:

DATABASES = {'default':
  {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': ':memory:',
  }
}

~/django_project$ ./manage.py test appname --traceback --settings=fasttest
Creating test database for alias 'default'...
.....................No database fixture specified. Please provide the path of at least one fixture in the command line.
 .
----------------------------------------------------------------------
Ran 22 tests in 8.426s

OK
Destroying test database for alias 'default'...

Update 2: obviously the comments, although I am thankful for the tries, are only shots in the dark. The database does not matter, neither SQLite3, nor Postgres testing DBs solve the problem.

like image 333
Vidul Avatar asked May 12 '12 16:05

Vidul


1 Answers

I had this same issue with test fixtures that had worked fine under 1.4.

For me, I had one test case where I wasn't using a fixture, and so I was setting fixtures to an empty set like this:

class MyTestCase(TestCase):
    fixtures = []

When I commented out that line, the error went away:

class MyTestCase(TestCase):
#    fixtures = []
like image 171
Tim White Avatar answered Nov 18 '22 15:11

Tim White