Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove u prefixes, skip test unless spatial db.

Refs #22001, d22b291
  • Loading branch information...
commit 834d78ffc3a7eb62d55ac269f83ac0e7473662ea 1 parent 659b567
@mjtamlyn mjtamlyn authored
View
6 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)),
View
5 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 @@ def assertTableNotExists(self, table):
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):
Please sign in to comment.
Something went wrong with that request. Please try again.