From 119154ca7f65d423bb742aa0e32ffcfcb21d4b87 Mon Sep 17 00:00:00 2001 From: Thomas Chaumeny Date: Thu, 4 Dec 2014 14:05:59 +0100 Subject: Refs #20392 -- Load fixtures once within TestCase --- docs/releases/1.8.txt | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 5ab42996ab..f9eaf83148 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -67,6 +67,25 @@ to accept expressions other than aggregates. Aggregates are now able to reference multiple fields, as well as perform arithmetic, similar to ``F()`` objects. +``TestCase`` data setup +~~~~~~~~~~~~~~~~~~~~~~~ + +:class:`~django.test.TestCase` has been refactored to allow for data +initialization at the class level using transactions and savepoints. Database +backends which do not support transactions, like MySQL with the MyISAM storage +engine, will still be able to run these tests but won't benefit from the +improvements. Tests are now run within two nested +:func:`~django.db.transaction.atomic()` blocks: one for the whole class and one +for each test. + +* The class method + :meth:`TestCase.setUpTestData() ` adds + the ability to setup test data at the class level. Using this technique can + speed up the tests as compared to using ``setUp()``. + +* Fixture loading within ``TestCase`` is now performed once for the whole + ``TestCase``. + Minor features ~~~~~~~~~~~~~~ @@ -515,10 +534,6 @@ Tests * The :func:`~django.test.override_settings` decorator can now affect the master router in :setting:`DATABASE_ROUTERS`. -* Added the ability to setup test data at the class level using - :meth:`TestCase.setUpTestData() `. Using - this technique can speed up the tests as compared to using ``setUp()``. - * Added test client support for file uploads with file-like objects. Validators -- cgit v1.3