Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get django-nose installed correctly?

I'm having trouble getting django-nose running.

Per the installation instructions, I installed by:

  1. Running pip install django-nose
  2. Adding 'django_nose' to INSTALLED_APPS in settings.py (including at as the very last app, in case of possible app order issues)
  3. Adding TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' to settings.py

When I run a test i.e. manage.py test, I get:

django.db.utils.DatabaseError: no such table: django_content_type

I figured I need to sync the database. I am using South. When I use manage.py syncdb, django_nose doesn't show up in either the list of synced apps nor the list of "Not synced (use migrations)" apps.

Finally, when I try syncing with south anyhow, i.e. manage.py schemamigration django_nose --initial, I get:

django.core.exceptions.ImproperlyConfigured: App with label django_nose is missing a models.py module.

I have Django 1.4 with South version 0.7.5 installed in a virtualenv.

What am I doing wrong? If nothing, how do I go about debugging this install problem?

like image 340
Ghopper21 Avatar asked Aug 31 '12 12:08

Ghopper21


2 Answers

Looks like it's an issue about apps ordering, a quote from django-nose manual:

Using With South

South installs its own test command that turns off migrations during testing. Make sure that django-nose comes after south in INSTALLED_APPS so that django_nose's test command is used.

like image 88
Fedor Gogolev Avatar answered Oct 13 '22 02:10

Fedor Gogolev


If you read the docs on github carefully, the problem is that when south is installed you need to put django_nose below south, read more.

So your INSTALLED_APPS in settings.py file should look something like below:

INSTALLED_APPS = (
.....other apps...
....

south,
django_nose,
) 
like image 28
apcelent Avatar answered Oct 13 '22 01:10

apcelent