Exemplo n.º 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)))
Exemplo n.º 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)))
Exemplo n.º 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)))
Exemplo n.º 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)))