Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gis: Fixed #5436, for Python 2.4 test runner compatibility with patch…

… from rcoup; GDAL tests now print that IllegalArgumentException is expected.

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6237 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e0a665e1213b1124f1c58dbfe048e38d8d89b061 1 parent 7c79d21
@jbronn jbronn authored
View
4 django/contrib/gis/tests/__init__.py
@@ -17,7 +17,7 @@ def suite():
"Builds a test suite for the GIS package."
s = TestSuite()
for test_suite in test_suite_names:
- tsuite = getattr(__import__('django.contrib.gis.tests', fromlist=[test_suite]),test_suite)
+ tsuite = getattr(__import__('django.contrib.gis.tests', globals(), locals(), [test_suite]),test_suite)
s.addTest(tsuite.suite())
return s
@@ -69,7 +69,7 @@ def run_tests(module_list, verbosity=1, interactive=True):
for test_model in test_models:
module_name = 'django.contrib.gis.tests.%s' % test_model
settings.INSTALLED_APPS.append(module_name)
- tsuite = getattr(__import__('django.contrib.gis.tests.%s' % test_model, fromlist=['tests']), 'tests')
+ tsuite = getattr(__import__('django.contrib.gis.tests.%s' % test_model, globals(), locals(), ['tests']), 'tests')
test_suite.addTest(tsuite.suite())
# Resetting the loaded flag to take into account what we appended to the INSTALLED_APPS
View
2  django/contrib/gis/tests/test_gdal_geom.py
@@ -105,6 +105,7 @@ def test07_closepolygons(self):
# Both rings in this geometry are not closed.
poly = OGRGeometry('POLYGON((0 0, 5 0, 5 5, 0 5), (1 1, 2 1, 2 2, 2 1))')
self.assertEqual(8, poly.point_count)
+ print "\nBEGIN - expecting IllegalArgumentException; safe to ignore.\n"
try:
c = poly.centroid
except OGRException:
@@ -112,6 +113,7 @@ def test07_closepolygons(self):
pass
else:
self.fail('Should have raised an OGRException!')
+ print "\nEND - expecting IllegalArgumentException; safe to ignore.\n"
# Closing the rings
poly.close_rings()
Please sign in to comment.
Something went wrong with that request. Please try again.