Loading django/test/utils.py +4 −3 Original line number Diff line number Diff line Loading @@ -4,12 +4,13 @@ from xml.dom.minidom import parseString, Node from django.conf import settings, UserSettingsHolder from django.core import mail from django.test.signals import template_rendered, setting_changed from django.template import Template, loader, TemplateDoesNotExist from django.template.loaders import cached from django.utils.translation import deactivate from django.test.signals import template_rendered, setting_changed from django.utils.encoding import force_str from django.utils.functional import wraps from django.utils import six from django.utils.translation import deactivate __all__ = ( Loading Loading @@ -133,7 +134,7 @@ def get_runner(settings, test_runner_class=None): test_module_name = '.'.join(test_path[:-1]) else: test_module_name = '.' test_module = __import__(test_module_name, {}, {}, test_path[-1]) test_module = __import__(test_module_name, {}, {}, force_str(test_path[-1])) test_runner = getattr(test_module, test_path[-1]) return test_runner Loading tests/regressiontests/test_runner/tests.py +6 −1 Original line number Diff line number Diff line """ Tests for django test runner """ from __future__ import absolute_import from __future__ import absolute_import, unicode_literals import sys from optparse import make_option Loading Loading @@ -150,6 +150,11 @@ class ManageCommandTests(unittest.TestCase): self.assertTrue(MockTestRunner.invoked, "The custom test runner has not been invoked") def test_bad_test_runner(self): with self.assertRaises(AttributeError): call_command('test', 'sites', testrunner='regressiontests.test_runner.NonExistentRunner') class CustomOptionsTestRunner(simple.DjangoTestSuiteRunner): option_list = ( Loading Loading
django/test/utils.py +4 −3 Original line number Diff line number Diff line Loading @@ -4,12 +4,13 @@ from xml.dom.minidom import parseString, Node from django.conf import settings, UserSettingsHolder from django.core import mail from django.test.signals import template_rendered, setting_changed from django.template import Template, loader, TemplateDoesNotExist from django.template.loaders import cached from django.utils.translation import deactivate from django.test.signals import template_rendered, setting_changed from django.utils.encoding import force_str from django.utils.functional import wraps from django.utils import six from django.utils.translation import deactivate __all__ = ( Loading Loading @@ -133,7 +134,7 @@ def get_runner(settings, test_runner_class=None): test_module_name = '.'.join(test_path[:-1]) else: test_module_name = '.' test_module = __import__(test_module_name, {}, {}, test_path[-1]) test_module = __import__(test_module_name, {}, {}, force_str(test_path[-1])) test_runner = getattr(test_module, test_path[-1]) return test_runner Loading
tests/regressiontests/test_runner/tests.py +6 −1 Original line number Diff line number Diff line """ Tests for django test runner """ from __future__ import absolute_import from __future__ import absolute_import, unicode_literals import sys from optparse import make_option Loading Loading @@ -150,6 +150,11 @@ class ManageCommandTests(unittest.TestCase): self.assertTrue(MockTestRunner.invoked, "The custom test runner has not been invoked") def test_bad_test_runner(self): with self.assertRaises(AttributeError): call_command('test', 'sites', testrunner='regressiontests.test_runner.NonExistentRunner') class CustomOptionsTestRunner(simple.DjangoTestSuiteRunner): option_list = ( Loading