mirror of
https://github.com/django/django.git
synced 2025-04-06 22:46:41 +00:00
[2.1.x] Fixed MySQL QuerySet.explain() test when running tests in reverse.
Backport of 13fe5a87f9554a6371f1d0914887bffcdf978a8a from master
This commit is contained in:
parent
7434ac4624
commit
60aa235f43
@ -69,6 +69,9 @@ class ExplainTests(TestCase):
|
||||
|
||||
@unittest.skipUnless(connection.vendor == 'mysql', 'MySQL specific')
|
||||
def test_mysql_text_to_traditional(self):
|
||||
# Initialize the cached property, if needed, to prevent a query for
|
||||
# the MySQL version during the QuerySet evaluation.
|
||||
connection.features.needs_explain_extended
|
||||
with CaptureQueriesContext(connection) as captured_queries:
|
||||
Tag.objects.filter(name='test').explain(format='text')
|
||||
self.assertEqual(len(captured_queries), 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user