Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#11635 closed (fixed)

testserver doesn't work with GeoDjango

Reported by: 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:

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)

testserver_backend.patch (3.3 KB) - added by whiteinge 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by whiteinge

comment:1 Changed 6 years ago by 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 6 years ago by Alex

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by jbronn

  • milestone set to 1.2
  • Resolution set to fixed
  • Status changed from new to 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.

comment:4 Changed 4 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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