Incorrect error message given when role does not have create database privilege
If a PostGIS database role does not have sufficient permissions to create a database, the testing suite returns a misleading message similar to:
"It appears the database, test_database_name, already exists. Type 'yes' to delete it, or 'no' to cancel: "
This occurs because the _create_with_cursor() method in /django/contrib/gis/db/backend/postgis/creation.py assumes that all errors in the method are related to a non-existing test database.
Change History
(5)
milestone: |
→ 1.1
|
Triage Stage: |
Unreviewed → Accepted
|
Component: |
Testing framework → GIS
|
Owner: |
changed from nobody to jbronn
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
This appears to only affect GIS databases, so I'm going to punt this to Justin's bailiwick. The fix seems fairly simple - we just need to print the exception obtained so that the user gets feedback on the underlying problem. The default creation backend already does this, so it's just a matter of porting the logic to somewhere near here