Questions tagged [django-nose]

Django test runner that uses nose.

django-nose is a Django test runner that uses nose.

It extends Django's built-in test command allowing to use all nose features and introduces more.

81 questions
6
votes
4 answers

How to get django-nose installed correctly?

I'm having trouble getting django-nose running. Per the installation instructions, I installed by: Running pip install django-nose Adding 'django_nose' to INSTALLED_APPS in settings.py (including at as the very last app, in case of possible app…
Ghopper21
  • 10,287
  • 10
  • 63
  • 92
4
votes
1 answer

Django TestCase with fixtures causes IntegrityError due to duplicate keys

I'm having trouble moving away from django_nose.FastFixtureTestCase to django.test.TestCase (or even the more conservative django.test.TransactionTestCase). I'm using Django 1.7.11 and I'm testing against Postgres 9.2. I have a Testcase class that…
rrauenza
  • 6,285
  • 4
  • 32
  • 57
4
votes
3 answers

Django (nose) test speeding up with reuse_db not working

I am using django-nose to run my unit tests in django (1.4). TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' Creating the database takes a long time. So I found out putting this in settings.py: os.environ['REUSE_DB'] = "1" should do the…
michel.iamit
  • 5,788
  • 9
  • 55
  • 74
4
votes
1 answer

Django with django-nose: two identical settings files with different behavior in running test command

With Django 1.4.5, I'm using django-nose 1.1.0. I have two settings files with no diff. -> % diff local_settings.py test_settings/sqlite.py I run the tests with: -> % python manage.py test foo --settings=local_settings and I get Ran 91 tests in…
Skylar Saveland
  • 11,116
  • 9
  • 75
  • 91
4
votes
1 answer

django-nose unit testing a celery task ... missing database data

I'm writing unit tests for a celery task using django-nose. It's fairly typical; a blank test database (REUSE_DB=0) that is pre-populated via a fixture at test time. The problem I have is that even though the TestCase is loading the fixture and I…
Dwight Gunning
  • 2,485
  • 25
  • 39
3
votes
1 answer

django-nose - Exclude directory in coverage

I'm using django-nose in order to measuring coverage of my test suite. I followed this doc to do this. With the standard configuration works well, and i succeed in cover all my application. I would exclude views directory from the coverage without…
Giordano
  • 5,422
  • 3
  • 33
  • 49
3
votes
1 answer

Grouping test results using Python coverage

I am testing a Django 1.6 application and I need some guidance using django-nose and coverage. Our Django app has the following structure: manage.py requirements.txt /appname /apps /app1 /app2 /app3 Our top appname…
grantmcconnaughey
  • 10,130
  • 10
  • 37
  • 66
3
votes
1 answer

coverage.py doesn't work with relative imports?

I am gathering the code coverage for my django app and looks like coverage.py doesn't collect the statistics if the module was imported relatively. More detailed: the directory structure looks like this: project __init__.py apps …
iurii
  • 2,597
  • 22
  • 25
3
votes
1 answer

django-nose collect-only runs tests

Nose and django-nose installed, when the following is ran: ./manage.py test --collect-only The following is output: nosetests --collect-only --verbosity=1 Creating test database for alias…
autodidacticon
  • 1,310
  • 2
  • 14
  • 33
3
votes
2 answers

Django test freeze using nose, django-nose and selenium

I'm trying to test my django project, I have an app with a very classic layout like so : project ├── __init__.py └── app ├── __init__.py ├── models.py ├── tests │   ├── __init__.py │   ├── models.py │   └── views.py └──…
Michaël
  • 63
  • 1
  • 4
2
votes
2 answers

Django_nose doesn't load basic fixtures, e.g. django_site example.com entry or admin permissions

With the current stable django_nose (0.1.3) the models aren't even properly found and loaded, I get the following exception when running the tests: django.db.utils.DatabaseError: (1146, "Table 'test_appdatabase.django_site' doesn't exist") using…
Pykler
  • 14,565
  • 9
  • 41
  • 50
2
votes
1 answer

How to prevent django tests from showing sys.stdout messages?

My problem is that since I have added logging to my django app when I run my unit tests all my log messages show in the console. I use nose as test runner. Its usual behaviour was to capture sys.stdout, only show console output if a test failed and…
Alvaro Aguilar
  • 694
  • 8
  • 23
2
votes
0 answers

How to test a new user activation in Django?

I am trying to test django.contrib.auth-based user signup view with django-nose, where an activation link is being sent to a new user: def signup(request): if request.method == 'POST': user_form = SignUpForm(request.POST) …
Laurynas Tamulevičius
  • 1,479
  • 1
  • 11
  • 25
2
votes
0 answers

Django 1.11 enter_transaction_management alternative

We are using django as our main backend, we use django-nose as our unit test framework. We have recently upgraded from django 1.3 to 1.11, a huge change, we are facing the following issue. When we are django 1.3, the unit tests ran fine, but with…
2
votes
2 answers

Django nose giving "ImportError: cannot import name setup"?

Django-nose installed in virtualenv is giving "ImportError: cannot import name setup" in runner.py when I run default server. On doing traceback I get this: File…
Sid
  • 589
  • 6
  • 20