Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#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


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)

testserver_backend.patch (3.3 KB ) - added by Nathaniel Whiteinge 15 years ago.

Download all attachments as: .zip

Change History (5)

by Nathaniel Whiteinge, 15 years ago

Attachment: testserver_backend.patch added

comment:1 by Nathaniel Whiteinge, 15 years ago

The GeoDjango docs should mention creating the following setting:

TESTSERVER_DATABASE_CREATOR = 'django.contrib.gis.db.backend.create_test_spatial_db'

comment:2 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:3 by jbronn, 14 years ago

milestone: 1.2
Resolution: fixed
Status: newclosed

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.

comment:4 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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