diff --git a/django/contrib/gis/tests/migrations/migrations/0001_initial.py b/django/contrib/gis/tests/migrations/migrations/0001_initial.py index 165a21700c..f3aab6c754 100644 --- a/django/contrib/gis/tests/migrations/migrations/0001_initial.py +++ b/django/contrib/gis/tests/migrations/migrations/0001_initial.py @@ -9,7 +9,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Neighborhood', fields=[ - (u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.TextField(unique=True)), ('geom', django.contrib.gis.db.models.fields.MultiPolygonField(srid=4326, null=True)), ], @@ -20,8 +20,8 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Household', fields=[ - (u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=True, primary_key=True)), - ('neighborhood', models.ForeignKey(to='gis.Neighborhood', to_field=u'id', null=True)), + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('neighborhood', models.ForeignKey(to='gis.Neighborhood', to_field='id', null=True)), ('address', models.TextField()), ('zip_code', models.IntegerField(null=True, blank=True)), ('geom', django.contrib.gis.db.models.fields.PointField(srid=4326, null=True, geography=True)), diff --git a/django/contrib/gis/tests/migrations/test_commands.py b/django/contrib/gis/tests/migrations/test_commands.py index 5454042100..1c675e4c86 100644 --- a/django/contrib/gis/tests/migrations/test_commands.py +++ b/django/contrib/gis/tests/migrations/test_commands.py @@ -1,6 +1,8 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals +from unittest import skipUnless + +from django.contrib.gis.tests.utils import HAS_SPATIAL_DB from django.core.management import call_command from django.db import connection from django.test import override_settings, override_system_checks, TransactionTestCase @@ -24,6 +26,7 @@ class MigrateTests(TransactionTestCase): with connection.cursor() as cursor: self.assertNotIn(table, connection.introspection.get_table_list(cursor)) + @skipUnless(HAS_SPATIAL_DB, "Spatial db is required.") @override_system_checks([]) @override_settings(MIGRATION_MODULES={"gis": "django.contrib.gis.tests.migrations.migrations"}) def test_migrate_gis(self):