mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Made table_names() output sorted.
Fixed #18218 -- previously Django's introspection table_names() and get_table_list() methods did not sort the output consistently. This resulted in random order of inspected models. This commit also removed all external usages of get_table_list(). table_names() should be used instead. Thanks to claudep for patch and report.
This commit is contained in:
@@ -40,6 +40,7 @@ class IntrospectionTests(TestCase):
|
||||
|
||||
def test_table_names(self):
|
||||
tl = connection.introspection.table_names()
|
||||
self.assertEqual(tl, sorted(tl))
|
||||
self.assertTrue(Reporter._meta.db_table in tl,
|
||||
"'%s' isn't in table_list()." % Reporter._meta.db_table)
|
||||
self.assertTrue(Article._meta.db_table in tl,
|
||||
|
||||
Reference in New Issue
Block a user