#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)
by , 16 years ago
| Attachment: | testserver_backend.patch added |
|---|
comment:1 by , 16 years ago
comment:2 by , 16 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 16 years ago
| 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'