summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsarahboyce <sarahvboyce95@gmail.com>2023-01-15 19:50:36 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-16 10:04:03 +0100
commitd550e3cccd77ceaea0d77fd2df472454a238a62e (patch)
treea2a4837ccce31a854ff4d1820a9803ec9cf0147d
parentd805010d6890ae542f154350320a99ca85563452 (diff)
[4.1.x] Fixed #23718 -- Doc'd that test mirrors require TransactionTestCase.
Co-authored-by: Christian Bundy <me@christianbundy.com> Backport of 0fbdb9784da915fce5dcc1fe82bac9b4785749e5 from main
-rw-r--r--docs/ref/settings.txt4
-rw-r--r--docs/topics/testing/advanced.txt4
2 files changed, 6 insertions, 2 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index e4cea3ddef..a61612f49b 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -839,7 +839,9 @@ but for all apps.
Default: ``None``
The alias of the database that this database should mirror during
-testing.
+testing. It depends on transactions and therefore must be used within
+:class:`~django.test.TransactionTestCase` instead of
+:class:`~django.test.TestCase`.
This setting exists to allow for testing of primary/replica
(referred to as master/slave by some databases)
diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt
index e6ebc346dd..33d2836eb9 100644
--- a/docs/topics/testing/advanced.txt
+++ b/docs/topics/testing/advanced.txt
@@ -230,7 +230,9 @@ will *not* be created. Instead the connection to ``replica``
will be redirected to point at ``default``. As a result, writes to
``default`` will appear on ``replica`` -- but because they are actually
the same database, not because there is data replication between the
-two databases.
+two databases. As this depends on transactions, the tests must use
+:class:`~django.test.TransactionTestCase` instead of
+:class:`~django.test.TestCase`.
.. _topics-testing-creation-dependencies: