From adcf1a73084d005a04ce6ebce9a5cecd42fed812 Mon Sep 17 00:00:00 2001 From: Hannes Ljungberg Date: Fri, 7 Feb 2020 22:44:17 +0100 Subject: Fixed #31248 -- Added missing space before USING SQL on PostGIS. --- tests/gis_tests/geoapp/test_indexes.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/gis_tests/geoapp/test_indexes.py (limited to 'tests') diff --git a/tests/gis_tests/geoapp/test_indexes.py b/tests/gis_tests/geoapp/test_indexes.py new file mode 100644 index 0000000000..ce6b998794 --- /dev/null +++ b/tests/gis_tests/geoapp/test_indexes.py @@ -0,0 +1,19 @@ +from unittest import skipUnless + +from django.db import connection +from django.db.models import Index +from django.test import TestCase + +from ..utils import postgis +from .models import City + + +class SchemaIndexesTests(TestCase): + @skipUnless(postgis, 'This is a PostGIS-specific test.') + def test_using_sql(self): + index = Index(fields=['point']) + editor = connection.schema_editor() + self.assertIn( + '%s USING ' % editor.quote_name(City._meta.db_table), + str(index.create_sql(City, editor)), + ) -- cgit v1.3