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

45 Views Asked by At

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 include().

I'm using Django version 2.1.5—and don't really have any idea where to start debugging this error. In this case the only difference between my tests running and throwing an error is the inclusion of the above line into my settings.py file.

Has anyone run into this problem before? I'm getting it with all of my views.

My main mysite/urls.py paths look like this (as per Django's documentation):

urlpatterns = [
    path('admin/', admin.site.urls),
    path('sound/', include('sound.urls')),
]

Which, just to see if it'd do anything, I changed to:

from sound import urls as sound_urls
urlpatterns = [
    path('admin/', admin.site.urls),
    path('soundtests/', sound_urls),
]

But this did not change the error at all.


This is not a duplicate of any of the other questions with this error. This problem only occurs when I use django_nose as my test runner. I am not referencing my views with strings in any of my urls.py files.

Edit: I do not get the same error simply running coverage run manage.py test using Django's default test runner.

0

There are 0 best solutions below