Opened 5 years ago

Closed 5 years ago

#14108 closed (duplicate)

update loaddata to load fixtures in multi db environment for testing

Reported by: berto Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords: fixtures loaddata tests
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I'm using django in a legacy multi database environment, where there are three distinct databases: default, transactions, reports. Note, these are unique databases, not mirrors of each other. When writing tests I needed the ability to load test data into these distinct databases.

The current multi_db fixture setup expects all databases to load a particular fixture. This patch allows the TestCase setting "multi_db=True" to try loading a fixture into each database rather than failing when data does not insert into one of the databases.

The patch is a bit incomplete. I'm not sure how to go about raising an exception if a particular fixture does not insert data into any database. Any thoughts would be great.

Attachments (1)

multi_db_loaddata.diff (2.3 KB) - added by berto 5 years ago.
load data into multiple distinct databases

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by berto

load data into multiple distinct databases

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #14068

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