Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#10397 closed (fixed)

Add support for DATABASE_SUPPORTS_TRANSACTIONS to django.contrib.gis.tests.run_tests

Reported by: mtredinnick Owned by: jbronn
Component: GIS Version: 1.0
Severity: Keywords: create_spatial_db gis tests
Cc: Almad Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by jbronn)

After r9756, it's no longer possible to run a full test suite for a set of applications (a Django "project") when using the gis test runner. This is because we need to set up DATABASE_SUPPORTS_TRANSACTIONS, which is used by, at a minimum, the auth tests.

This seems like the tip of the iceberg in some ways, though. There's already a handy function to help with this, but it's part of django.db.backends.creation.BaseDatabaseCreation, which django.contrib.gis doesn't use at all for creating test databases. I suspect the solution is to break up the BaseDatabaseCreation class into basic stuff and test stuff so that gis can use the subclass the latter.

Attachments (1)

create_spatial_db_support_transactions.diff (565 bytes) - added by jbronn 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by Almad

  • Cc Almad added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by jbronn

  • Description modified (diff)
  • Has patch set
  • Keywords create_spatial_db gis tests added
  • milestone set to 1.1
  • Owner changed from nobody to jbronn
  • Status changed from new to assigned

which is used by, at a minimum, the auth tests

It's also used by any unit test that subclasses django.test.TestCase. The attached patch adds this setting; MySQL and Oracle shouldn't be affected because it's only PostGIS that really uses something different than the default connection.creation.create_test_db.

Changed 7 years ago by jbronn

comment:3 Changed 7 years ago by mtredinnick

  • Triage Stage changed from Unreviewed to Ready for checkin

This looks good to me. Commit it, already. :-)

comment:4 Changed 7 years ago by jbronn

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [9978]) Fixed #10397 -- made GIS test runner compatible with changes in r9756.

comment:5 Changed 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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