diff --git a/django/contrib/gis/db/backends/postgis/creation.py b/django/contrib/gis/db/backends/postgis/creation.py index 4447b64db80..43ae9a0331f 100644 --- a/django/contrib/gis/db/backends/postgis/creation.py +++ b/django/contrib/gis/db/backends/postgis/creation.py @@ -91,6 +91,6 @@ class PostGISCreation(DatabaseCreation): self.connection.settings_dict["NAME"] = test_database_name cursor = self.connection.cursor() cursor.execute("CREATE EXTENSION postgis") - cursor.commit() + cursor.connection.commit() return test_database_name