1
0
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:
Anssi Kääriäinen
2012-04-29 02:11:55 +03:00
parent c2055ee161
commit 527cce80dc
6 changed files with 22 additions and 8 deletions

View File

@@ -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,