Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#11635 closed (fixed)

testserver doesn't work with GeoDjango

Reported by: Nathaniel Whiteinge Owned by: nobody
Component: GIS Version: master
Severity: Keywords: testserver gis
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Nathaniel Whiteinge

Attachment: testserver_backend.patch added

comment:1 Changed 7 years ago by Nathaniel Whiteinge

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

The GeoDjango docs should mention creating the following setting:

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

comment:2 Changed 7 years ago by Alex Gaynor

Triage Stage: UnreviewedAccepted

comment:3 Changed 7 years ago by jbronn

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 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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