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
0
votes
0 answers

Error only present when using Django Nose test runner: View must be a callable or a list/tuple in the case of include()

All of my tests run as expected when I use Django's default test runner. When I add TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' to my project's settings, I receive a TypeError that states view must be a callable or a list/tuple in the case of…
AmagicalFishy
  • 1,249
  • 1
  • 12
  • 36
0
votes
1 answer

How to specified parameters of the method to be ran while i am using python nosetests?

for example: there is a function to be ran by nosetest, def test_example(flag): nose.tools.assert_equal(flag, 'ok') How to specified parameters of this function when i run commands 'nosetest' in the console? pls help me, many tks!!
zhangke
  • 1
  • 1
0
votes
0 answers

JsonResponse is been read as string during django_nose testing

having a head ache here. I have this simple API that I want to test out but can't so far. It works partly. The error happens if the user is blocked or deleted, which says: 'str' object has no attribute status_code. But I think I am indeed…
Nie Selam
  • 1,343
  • 2
  • 24
  • 56
0
votes
0 answers

django test (nose) stuck after add package fixtures

I have django test run with nosetests. But after I add package fixtures, python manage.py test can't run as normal and get stuck. package fixtures (I had minimize it to debug failure reason): def setup_package(): pass def teardown_package(): …
Xiaochen Cui
  • 2,337
  • 2
  • 13
  • 13
0
votes
1 answer

django_nose ignores wrapped tests

I have such kind of wrapper def external_services_mock(f): @patch('service.remote_call1') @patch('service.remote_call2') def wrapper(self, remote_call2_mock, remote_call1_mock, *args, **kwargs): remote_call1_mock.return_value =…
40min
  • 117
  • 1
  • 9
0
votes
0 answers

Unable to run an individual test with Django 1.8

Having followed the advice in these two answers, I'm still unable to run only a single django test in the way it describes. I can run them all, but that takes a long time and makes debugging harder. My project structure looks like…
James Bradbury
  • 1,708
  • 1
  • 19
  • 31
0
votes
1 answer

WindowsError: [Error 32] when trying to delete FileField in Django

I am writing a django-nose test to test feature for document uploading. In the test I mock new document using SimpleUploadedFile() from django.core.files.uploadedfile. The problem is that the file associated with the document instance cannot be…
0
votes
0 answers

PostgreSQL + Django AutoField id doesn't get restarted after flush

I am currently testing Django project using django-nose. I use PostgreSQL for my DB. The problem I am facing is: In test setUp method I create one Emp instance and save it. Then I execute this: Emp.objects.filter(empId=1) but this doesn't exist.…
Laurynas Tamulevičius
  • 1,479
  • 1
  • 11
  • 25
0
votes
0 answers

nose not running all tests

So for this function, I have a json file with list of files , which are tests def wantFunction(self, function): test = '.'.join([function.__module__, function.__name__]) if test in self.ctrl.keys(): for in evidence.values(): …
Harshdeep Singh
  • 327
  • 1
  • 5
  • 18
0
votes
1 answer

Nose test case fails to set up with "Transaction managed block ended with pending COMMIT/ROLLBACK"

We have a large Django project with approximately 10,000 Django+Nose unit tests. We very rarely use transactions in our codebase. Probably 99% of our code base does not use transactions. The project is on Django 1.5.8 and Django Nose 1.4.1. (Yes, I…
Nick Williams
  • 2,864
  • 5
  • 29
  • 43
0
votes
1 answer

'module' object has no attribute 'commit_unless_managed'

I am using django 1.8 and django-nose 1.4 and while I run REUSE_DB=1 python manage.py test It shows error message 'module' object has no attribute 'commit_unless_managed' What may the the solution ?
Bishnu Bhattarai
  • 2,800
  • 8
  • 36
  • 44
0
votes
1 answer

Django-nose test html error

I'm testing a web application using Django-nose to monitor the code coverage. At first it worked perfectly well, but when trying to generate HTML it fails with the error: Imput error: No module named copy_reg It happened after a few times (until…
Ivo Valchev
  • 215
  • 3
  • 11
0
votes
1 answer

ImportError under admin.autodiscover() when trying to run single django-nose test

I'm trying to run single test using django-nose: ./manage.py test lead.tests:LeadStatTests.basic_stat_test And following ImportError occurs: ====================================================================== ERROR: Failure: ImportError (cannot…
kolen
  • 2,752
  • 2
  • 27
  • 35
0
votes
1 answer

Can't get Nose to honor the attributes I set on my tests

I'm using Django 1.7 with django-nose 1.4 and nose 1.3.6. According to the documentation, I should be able to select tests to be run by using attributes. I have a test set like this: from nose.plugins.attrib import attr from django_webtest import…
Louis
  • 146,715
  • 28
  • 274
  • 320
0
votes
1 answer

How to stop Tasks firing during Django Nose tests?

I have a testing which I use Django Nose. During a model creation I have a Celery task which is fired. def save(self, *args, **kwargs): celery_app.send_task('test.apps.action', args=["BB", …
Prometheus
  • 32,405
  • 54
  • 166
  • 302