#22632 closed Cleanup/optimization (fixed)
Spatial backend tests uses hardcoded set of backends
Reported by: | Jani Tiainen | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | gis database testing |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In django.contrib.gis.tests.utils is hardcoded parts that spatial backend must be located inside 'django.contrib.gis' and there are bunch of hardcoded imports depending on selected backend.
This makes impossible to test any custom backend for GIS options.
Change History (12)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 11 years ago
One more thing, we should follow the work recently done to abstract the backend name and concentrate on backend capabilities instead. See c70a61eb49e4ed8f3b2a5011a7a5e6cda43c8598 and commits around it.
comment:3 by , 10 years ago
Has patch: | set |
---|---|
Version: | 1.6 → master |
In that pull request (https://github.com/django/django/pull/3080), I set the base to use connection.features
to test for various GIS features. As a start and proof of concept, I got rid of HAS_SPATIAL_DB
. Reviews welcome.
comment:8 by , 10 years ago
A few more here: https://github.com/django/django/pull/3109
Note that I'm not able to test those changes on Oracle GIS. If anyone has this ability and some time to spent, feel free to help! I also won't able to tackle the remaining no_oracle
flags.
comment:10 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I think that now about 90% of hardcoded references to backends have been replaced by database features, which should allow custom backends to run GIS tests. There is probably some work remaining, but I suggest now to open individual tickets for such issues.
You are referring to
has_spatial_db
, I suppose. You are right, however it's a bit tricky because that utility is used many times during test modules import time. We have to be careful not to have to load too much things to determine if the backend is gis-enabled or not.