Browse Source

Fixed #23718 -- Doc'd that test mirrors require TransactionTestCase.

Co-authored-by: Christian Bundy <me@christianbundy.com>
sarahboyce 2 years ago
parent
commit
0fbdb9784d
2 changed files with 6 additions and 2 deletions
  1. 3 1
      docs/ref/settings.txt
  2. 3 1
      docs/topics/testing/advanced.txt

+ 3 - 1
docs/ref/settings.txt

@@ -828,7 +828,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)

+ 3 - 1
docs/topics/testing/advanced.txt

@@ -241,7 +241,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: