diff options
author | Claude Paroz <claude@2xlibre.net> | 2017-08-03 23:33:06 +0200 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2017-08-08 17:37:43 +0200 |
commit | 831358f23d545b8dba017c6b26bd295ba9f6c17d (patch) | |
tree | d22958302bf751e10620dd8fa837c2911be0239a /tests/model_indexes | |
parent | d18227e341ed044980d02a1f65f3874166552ded (diff) | |
download | django-831358f23d545b8dba017c6b26bd295ba9f6c17d.tar.gz |
Fixed #28465 -- Unified index SQL creation in DatabaseSchemaEditor
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/model_indexes')
-rw-r--r-- | tests/model_indexes/tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
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()) |