-
Notifications
You must be signed in to change notification settings - Fork 348
Update database.rst #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update database.rst #591
Conversation
Add specific reference to primary/replica configuration for testing. It might help folks like me to recognize that this is another important instance of using multiple databases :)
Codecov Report
@@ Coverage Diff @@
## master #591 +/- ##
=======================================
Coverage 91.92% 91.92%
=======================================
Files 33 33
Lines 1660 1660
Branches 143 143
=======================================
Hits 1526 1526
Misses 95 95
Partials 39 39
Continue to review full report at Codecov.
|
@blueyed, I wonder if there is any chance of this PR getting merged. The specific reference to primary/replica db setups would have saved me a bit of time, and I'm sure it will save other folks time as well. Is there anything I can do to facilitate getting this in? |
Thanks for caring about docs, and sorry for the late reply. What about this patch on top? diff --git c/docs/database.rst i/docs/database.rst
index 3f9d1ad..5714e12 100644
--- c/docs/database.rst
+++ i/docs/database.rst
@@ -71,17 +71,20 @@ Tests requiring multiple databases
----------------------------------
Currently ``pytest-django`` does not specifically support Django's
-multi-database support. You can however use normal Django
-``TestCase`` instances to use it's `multi_db
-<https://docs.djangoproject.com/en/1.9/topics/testing/advanced/#tests-and-multiple-databases>`_
-support. In particular, if your database is configured for replication, be sure to read
-about `testing primary/replica configurations <https://docs.djangoproject.com/en/2.0/topics/testing/advanced/#testing-primary-replica-configurations>`_.
+multi-database support.
+
+You can however use normal :class:`~django.test.TestCase` instances to use its
+:ref:`django:topics-testing-advanced-multidb` support.
+In particular, if your database is configured for replication, be sure to read
+about :ref:`django:topics-testing-primaryreplica`.
If you have any ideas about the best API to support multiple databases
directly in ``pytest-django`` please get in touch, we are interested
in eventually supporting this but unsure about simply following
Django's approach.
+See `https://github.com/pytest-dev/pytest-django/pull/431` for an idea /
+discussion to approach this.
``--reuse-db`` - reuse the testing database between test runs
-------------------------------------------------------------- |
@blueyed I love it. That's fantastic! Thanks so much for the update. It will really help to find the right documentation to solve a non-obvious failure mode! |
Great! |
Enhanced by committer. Closes pytest-dev/pytest-django#591.
Add specific reference to primary/replica configuration for testing. It might help folks like me to recognize that this is another important instance of using multiple databases :)
This is pursuant to discussion on #429 about a place where not setting the mirror configuration for a db replica caused intermittent failures in pytest during teardown.