mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
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
This commit is contained in:
parent
7c79d21eb4
commit
e0a665e121
@ -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
|
||||
|
@ -105,6 +105,7 @@ class OGRGeomTest(unittest.TestCase):
|
||||
# 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 @@ class OGRGeomTest(unittest.TestCase):
|
||||
pass
|
||||
else:
|
||||
self.fail('Should have raised an OGRException!')
|
||||
print "\nEND - expecting IllegalArgumentException; safe to ignore.\n"
|
||||
|
||||
# Closing the rings
|
||||
poly.close_rings()
|
||||
|
Loading…
x
Reference in New Issue
Block a user