#11635 closed (fixed)
testserver doesn't work with GeoDjango
Reported by: | Nathaniel Whiteinge | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Keywords: | testserver gis | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The testserver
management command doesn't work with GeoDjango since a geo-spatial aware database is not created.
IMO, the cleanest solution is to create a new setting, similar to the TEST_RUNNER
setting, since it is possible future database backends may also have additional requirements. (CouchDB?)
An initial stab is attached. The part in django.test.utils
is hacky, but I'm not sure how else to tackle it. Also, I'm not sure how to link to the testserver
docs in settings.txt
.
Attachments (1)
Change History (5)
Changed 14 years ago by
Attachment: | testserver_backend.patch added |
---|
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 Changed 14 years ago by
milestone: | → 1.2 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
This was fixed when multi-db was merged into trunk. Particularly, the spatial backends are now full-fledged Django database backends, so when the testserver
command calls connection.create_test_db
, the spatial backend's machinery automatically takes care of the rest. Thus, no additional settings are required.
The GeoDjango docs should mention creating the following setting:
TESTSERVER_DATABASE_CREATOR = 'django.contrib.gis.db.backend.create_test_spatial_db'