Commit Graph

8 Commits

Author SHA1 Message Date
Mariusz Felisiak 2c7846d992
Fixed #33333 -- Fixed setUpTestData() crash with models.BinaryField on PostgreSQL.
This makes models.BinaryField pickleable on PostgreSQL.

Regression in 3cf80d3fcf.

Thanks Adam Zimmerman for the report.
2021-12-03 11:56:22 +01:00
SwastikTripathi 76f07b4fcf Fixed #33278 -- Improved error for connection/query attempts against disallowed databases in tests. 2021-11-15 11:46:10 +01:00
Mariusz Felisiak 2e10abeb7f Refs #31395 -- Removed support for assigning objects which don't support deepcopy() in setUpTestData().
Per deprecation timeline.
2021-09-20 21:23:01 +02:00
Mateo Radman 2231429991 Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using "assert". 2021-07-05 13:31:03 +02:00
Simon Charette 3cf80d3fcf Fixed #31395 -- Made setUpTestData enforce in-memory data isolation.
Since it's introduction in Django 1.8 setUpTestData has been suffering
from a documented but confusing caveat due to its sharing of attributes
assigned during its execution with all test instances.

By keeping track of class attributes assigned during the setUpTestData
phase its possible to ensure only deep copies are provided to test
instances on attribute retreival and prevent manual setUp gymnastic to
work around the previous lack of in-memory data isolation.

Thanks Adam Johnson for the extensive review.
2020-05-15 20:22:52 +02:00
Simon Charette f5b635086a Refs #28478 -- Prevented connection attempts against disallowed databases in tests.
Mocking connect as well as cursor methods makes sure an appropriate error
message is surfaced when running a subset of test attempting to access a
a disallowed database.
2019-01-14 16:05:00 -05:00
Simon Charette 8c775391b7 Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in favor of databases. 2019-01-10 19:11:21 -05:00
Jon Dufresne fcd08c1757 Fixed #11665 -- Made TestCase check deferrable constraints after each test. 2016-02-13 06:53:39 -05:00