mirror of
https://github.com/django/django.git
synced 2025-11-24 21:00:12 +00:00
Made MigrationRecorder cache has_table() result if django_migrations table exists.
This commit is contained in:
parent
9d756afb07
commit
ea8cbca579
2 changed files with 19 additions and 1 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue