Running gis tests via runtests doesn't work.
|Reported by:||Malcolm Tredinnick||Owned by:||jbronn|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In r9918, we added the facility to use
TEST_RUNNER for Django's standard
runtests.py path. I naïvely tried to use that today and the wheels fell off in an interesting fashion.
The settings file was:
DATABASE_ENGINE = 'postgresql_psycopg2' DATABASE_NAME = 'django' TEST_RUNNER = 'django.contrib.gis.tests.run_gis_tests' POSTGIS_TEMPLATE = 'template_postgis'
and then I invoked
./runtests.py --settings=settings7 gis
and was handed
Traceback (most recent call last): File "./runtests.py", line 187, in <module> django_tests(int(options.verbosity), options.interactive, args) File "./runtests.py", line 157, in django_tests failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive, extra_tests=extra_tests) File "/usr/lib/python2.5/site-packages/django/contrib/gis/tests/__init__.py", line 88, in run_gis_tests gis_suite, test_models = geo_suite() File "/usr/lib/python2.5/site-packages/django/contrib/gis/tests/__init__.py", line 50, in geo_suite tsuite = getattr(__import__('django.contrib.gis.tests', globals(), locals(), [test_suite]),test_suite) File "/usr/lib/python2.5/site-packages/django/contrib/gis/tests/test_spatialrefsys.py", line 4, in <module> from django.contrib.gis.models import SpatialRefSys ImportError: cannot import name SpatialRefSys
Something's going wonky in the import stuff in
get_suite(), but I can't figure it out yet. Would be nice if this more or less just worked at some point, though.
This isn't a regression, by the way, since, previously, no tests would be run at all, as
runtests.py wouldn't use the gis test runner. So it's an enhancement to make this work. Also, it might well be made easier once we land #8193.
Change History (9)
comment:1 Changed 8 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Accepted|