Ticket #5436: test_runner_py24.patch

File test_runner_py24.patch, 1.1 KB (added by rcoup, 8 years ago)
  • django/contrib/gis/tests/__init__.py

     
    1717    "Builds a test suite for the GIS package."
    1818    s = TestSuite()
    1919    for test_suite in test_suite_names:
    20         tsuite = getattr(__import__('django.contrib.gis.tests', fromlist=[test_suite]),test_suite)
     20        tsuite = getattr(__import__('django.contrib.gis.tests', globals(), locals(), [test_suite]),test_suite)
    2121        s.addTest(tsuite.suite())
    2222    return s
    2323
     
    6969    for test_model in test_models:
    7070        module_name = 'django.contrib.gis.tests.%s' % test_model
    7171        settings.INSTALLED_APPS.append(module_name)
    72         tsuite = getattr(__import__('django.contrib.gis.tests.%s' % test_model, fromlist=['tests']), 'tests')
     72        tsuite = getattr(__import__('django.contrib.gis.tests.%s' % test_model, globals(), locals(), ['tests']), 'tests')
    7373        test_suite.addTest(tsuite.suite())
    7474
    7575    # Resetting the loaded flag to take into account what we appended to the INSTALLED_APPS
Back to Top