mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Made MigrationRecorder cache has_table() result if django_migrations table exists.
This commit is contained in:
committed by
Mariusz Felisiak
parent
9d756afb07
commit
ea8cbca579
@@ -48,6 +48,16 @@ class RecorderTests(TestCase):
|
||||
set(),
|
||||
)
|
||||
|
||||
def test_has_table_cached(self):
|
||||
"""
|
||||
The has_table() method caches a positive result and not continually
|
||||
query for the existence of the migrations table.
|
||||
"""
|
||||
recorder = MigrationRecorder(connection)
|
||||
with self.assertNumQueries(1):
|
||||
self.assertEqual(recorder.has_table(), True)
|
||||
self.assertEqual(recorder.has_table(), True)
|
||||
|
||||
|
||||
class LoaderTests(TestCase):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user