diff --git a/mapit/tests/test_import_commands.py b/mapit/tests/test_import_commands.py index b4d3e9e2..c42ebe60 100644 --- a/mapit/tests/test_import_commands.py +++ b/mapit/tests/test_import_commands.py @@ -4,6 +4,7 @@ from django.core.management import call_command from django.conf import settings from django.utils.six import StringIO +from django.contrib.gis.gdal.prototypes import ds from ..models import Type, NameType, Area, Generation, Country @@ -11,6 +12,13 @@ class MapitImportTest(TestCase): """Test the mapit_import management command""" + def setUp(self): + # Forcefully register a GDAL datasource driver, because Django has a + # bug where it assumes that any existing drivers mean they're all + # available, which doesn't seem to be the case. + if not ds.get_driver_count(): + ds.register_all() + def test_loads_kml_files(self): # Assert no areas in db before self.assertEqual(Area.objects.count(), 0)