Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#17611 closed Bug (invalid)

django.contrib.gis raises exception on ./ test

Reported by: andrey@… Owned by: nobody
Component: GIS Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


from django.test.simple import run_tests as base_run_tests
ImportError: cannot import name run_tests

[15:32:04]: [Step 2/2] Starting: /opt/TeamCity/buildAgent/temp/agentTmp/custom_script7587252072882195123
[15:32:04]: [Step 2/2] in directory: /opt/TeamCity/buildAgent/work/a2bf5278fd80ad01
[15:32:05]: [Step 2/2] Traceback (most recent call last):
[15:32:05]: [Step 2/2]   File "./", line 11, in <module>
[15:32:05]: [Step 2/2]     execute_manager(settings)
[15:32:05]: [Step 2/2]   File "/tmp/visamap-tc-virtualenv/src/django/django/core/management/", line 435, in execute_manager
[15:32:05]: [Step 2/2]     utility.execute()
[15:32:05]: [Step 2/2]   File "/tmp/visamap-tc-virtualenv/src/django/django/core/management/", line 358, in execute
[15:32:05]: [Step 2/2]     self.fetch_command(subcommand).run_from_argv(self.argv)
[15:32:05]: [Step 2/2]   File "/tmp/visamap-tc-virtualenv/src/django/django/core/management/commands/", line 49, in run_from_argv
[15:32:05]: [Step 2/2]     super(Command, self).run_from_argv(argv)
[15:32:05]: [Step 2/2]   File "/tmp/visamap-tc-virtualenv/src/django/django/core/management/", line 196, in run_from_argv
[15:32:05]: [Step 2/2]     self.execute(*args, **options.__dict__)
[15:32:05]: [Step 2/2]   File "/tmp/visamap-tc-virtualenv/src/django/django/core/management/", line 232, in execute
[15:32:05]: [Step 2/2]     output = self.handle(*args, **options)
[15:32:05]: [Step 2/2]   File "/tmp/visamap-tc-virtualenv/local/lib/python2.7/site-packages/south/management/commands/", line 8, in handle
[15:32:05]: [Step 2/2]     super(Command, self).handle(*args, **kwargs)
[15:32:05]: [Step 2/2]   File "/tmp/visamap-tc-virtualenv/src/django/django/core/management/commands/", line 71, in handle
[15:32:05]: [Step 2/2]     test_runner = TestRunner(**options)
[15:32:05]: [Step 2/2]   File "/tmp/visamap-tc-virtualenv/src/django/django/contrib/gis/tests/", line 6, in run_tests
[15:32:05]: [Step 2/2]     from django.test.simple import run_tests as base_run_tests
[15:32:05]: [Step 2/2] ImportError: cannot import name run_tests
[15:32:05]: [Step 2/2] Process exited with code 1
[15:32:06]: [Step 2/2] Step Command Line failed

Change History (4)

comment:1 Changed 7 years ago by anonymous

Resolution: invalid
Status: newclosed

it was my fail. Can you throw exception with instructions how to change user's

comment:2 Changed 7 years ago by anonymous

Resolution: invalid
Status: closedreopened

comment:3 Changed 7 years ago by Anssi Kääriäinen

Resolution: invalid
Status: reopenedclosed

I am going to close this ticket, as it seems this should be invalid (as said in comment:1). I don't know why this was then reopened, a bit confusing... So if I am mistaken, please reopen.

comment:4 Changed 6 years ago by geoffhing@…

I ran into this issue when switching from Django 1.3.1 to 1.4.0

I wanted to add this comment to clarify the reason for getting the exception and my fix.

The exception is thrown because I had set the test runner to the GeoDjango like this:


According to the Testing GeoDjango Apps documentation:

In Django 1.2, the addition of Spatial Backends simplified the process of testing GeoDjango applications. The process is now the same as Testing Django applications.

So, specifying the GeoDjango test runner is no longer required and now seems to break things.

Note: See TracTickets for help on using tickets.
Back to Top