From 831358f23d545b8dba017c6b26bd295ba9f6c17d Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 3 Aug 2017 23:33:06 +0200 Subject: Fixed #28465 -- Unified index SQL creation in DatabaseSchemaEditor Thanks Tim Graham for the review. --- tests/model_indexes/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/model_indexes') diff --git a/tests/model_indexes/tests.py b/tests/model_indexes/tests.py index 555b0bb0aa..381f4fdcf8 100644 --- a/tests/model_indexes/tests.py +++ b/tests/model_indexes/tests.py @@ -113,7 +113,7 @@ class IndexesTests(SimpleTestCase): ]: with self.subTest(fields=fields): index = models.Index(fields=fields, db_tablespace='idx_tbls2') - self.assertIn('"idx_tbls2"', index.create_sql(Book, editor).lower()) + self.assertIn('"idx_tbls2"', str(index.create_sql(Book, editor)).lower()) # Indexes without db_tablespace attribute. for fields in [['author'], ['shortcut', 'isbn'], ['title', 'author']]: with self.subTest(fields=fields): @@ -124,11 +124,11 @@ class IndexesTests(SimpleTestCase): if settings.DEFAULT_INDEX_TABLESPACE: self.assertIn( '"%s"' % settings.DEFAULT_INDEX_TABLESPACE, - index.create_sql(Book, editor).lower() + str(index.create_sql(Book, editor)).lower() ) else: - self.assertNotIn('TABLESPACE', index.create_sql(Book, editor)) + self.assertNotIn('TABLESPACE', str(index.create_sql(Book, editor))) # Field with db_tablespace specified on the model and an index # without db_tablespace. index = models.Index(fields=['shortcut']) - self.assertIn('"idx_tbls"', index.create_sql(Book, editor).lower()) + self.assertIn('"idx_tbls"', str(index.create_sql(Book, editor)).lower()) -- cgit v1.2.1