Пример #1
0
    def run(self):
        sys.dont_write_bytecode = True
        os.environ['DJANGO_SETTINGS_MODULE'] = 'test_suite.settings_for_tests'
        setup_django()
        # import django
        # try:
        #     django.setup()
        # except AttributeError:
        #     pass

        try:
            from django.utils.unittest import TextTestRunner, defaultTestLoader
        except ImportError:
            print("Please install Django => 1.4.2 to run the test suite")
            exit(-1)

        from test_suite import (
            test_forms, test_models, test_templatetags, test_widgets)
        suite = defaultTestLoader.loadTestsFromModule(test_forms)
        suite.addTests(defaultTestLoader.loadTestsFromModule(test_models))
        suite.addTests(
            defaultTestLoader.loadTestsFromModule(test_templatetags))
        suite.addTests(defaultTestLoader.loadTestsFromModule(test_widgets))
        runner = TextTestRunner()
        result = runner.run(suite)
        if result.wasSuccessful() is not True:
            raise SystemExit(int(bool(result.errors or result.failures)))
Пример #2
0
    def run(self):
        sys.dont_write_bytecode = True
        os.environ['DJANGO_SETTINGS_MODULE'] = 'test_suite.settings_for_tests'
        setup_django()
        # import django
        # try:
        #     django.setup()
        # except AttributeError:
        #     pass

        try:
            from django.utils.unittest import TextTestRunner, defaultTestLoader
        except ImportError:
            print("Please install Django => 1.4.2 to run the test suite")
            exit(-1)

        from test_suite import (test_forms, test_models, test_templatetags,
                                test_widgets)
        suite = defaultTestLoader.loadTestsFromModule(test_forms)
        suite.addTests(defaultTestLoader.loadTestsFromModule(test_models))
        suite.addTests(
            defaultTestLoader.loadTestsFromModule(test_templatetags))
        suite.addTests(defaultTestLoader.loadTestsFromModule(test_widgets))
        runner = TextTestRunner()
        result = runner.run(suite)
        if result.wasSuccessful() is not True:
            raise SystemExit(int(bool(result.errors or result.failures)))
Пример #3
0
    def run(self):
        sys.dont_write_bytecode = True
        os.environ['DJANGO_SETTINGS_MODULE'] = 'test_suite.settings_for_tests'
        setup_django()

        try:
            from django.utils.unittest import TextTestRunner, defaultTestLoader
        except ImportError:
            from unittest import TextTestRunner, defaultTestLoader

        from test_suite import (test_forms, test_models, test_templatetags,
                                test_widgets)
        suite = defaultTestLoader.loadTestsFromModule(test_forms)
        suite.addTests(defaultTestLoader.loadTestsFromModule(test_models))
        suite.addTests(
            defaultTestLoader.loadTestsFromModule(test_templatetags))
        suite.addTests(defaultTestLoader.loadTestsFromModule(test_widgets))
        runner = TextTestRunner()
        result = runner.run(suite)
        if result.wasSuccessful() is not True:
            raise SystemExit(int(bool(result.errors or result.failures)))
Пример #4
0
    def run(self):
        sys.dont_write_bytecode = True
        os.environ['DJANGO_SETTINGS_MODULE'] = 'test_suite.settings_for_tests'
        setup_django()

        try:
            from django.utils.unittest import TextTestRunner, defaultTestLoader
        except ImportError:
            from unittest import TextTestRunner, defaultTestLoader

        from test_suite import (
            test_forms, test_models, test_templatetags, test_widgets)
        suite = defaultTestLoader.loadTestsFromModule(test_forms)
        suite.addTests(defaultTestLoader.loadTestsFromModule(test_models))
        suite.addTests(
            defaultTestLoader.loadTestsFromModule(test_templatetags))
        suite.addTests(defaultTestLoader.loadTestsFromModule(test_widgets))
        runner = TextTestRunner()
        result = runner.run(suite)
        if result.wasSuccessful() is not True:
            raise SystemExit(int(bool(result.errors or result.failures)))
Пример #5
0
 def run_suite(self, suite, **kwargs):
     """ Hook in from parent class so we can use our own result class """
     ttr = TextTestRunner(verbosity=self.verbosity,
                          failfast=self.failfast,
                          resultclass=MHLResult)
     return ttr.run(suite)
Пример #6
0
	def run_suite(self, suite, **kwargs):
		""" Hook in from parent class so we can use our own result class """
		ttr = TextTestRunner(verbosity=self.verbosity, failfast=self.failfast, resultclass=MHLResult)
		return ttr.run(suite)