#19296 closed Bug (fixed)
LiveServerTestCase does not share connection to sqlite if using spatialite
Reported by: | Owned by: | Claude Paroz | |
---|---|---|---|
Component: | Testing framework | Version: | 1.4 |
Severity: | Normal | Keywords: | sqlite spatialite LiveServerTestCase |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Like the title says, if the database backend is set to 'django.contrib.gis.db.backends.spatialite' instead of 'django.db.backends.sqlite3' it doesn't properly share the connection with the new threads when using LiveServerTestCase. See: https://github.com/django/django/blob/82b3e6ffcb9d810cc0e3ec27d25f89ce1fd525e0/django/test/testcases.py#L1080
Attachments (1)
Change History (8)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Bug |
comment:2 by , 12 years ago
Owner: | changed from | to
---|
by , 12 years ago
Attachment: | patch.diff added |
---|
comment:3 by , 12 years ago
Has patch: | set |
---|
I added a patch that fixes this. I was unsure how to write a test for this. Conceivably the test could start a LiveServer and override the default database to be spatialite and then make sure that a particular view loads data from the DB correctly. This test is in core and geodjango is in contrib, so I was not sure where the test should go or if it was reasonable to require spatialite be installed in order to run the tests of django core. Please advise on what test is required for this.
comment:4 by , 12 years ago
Owner: | changed from | to
---|
I'm not convinced this needs testing. Thanks for your patch, I will commit something soon.
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
patch to also support spatialite