Example #1
0
    def setup_test_environment(self):
        self.testdb.initialize_test_db()
        if self.wsgi_starts:
            print 'Starting django wsgi server.'
            defaults = {}
            if hasattr(settings, 'TEST_WSGI_HOST'):
                defaults['host'] = settings.TEST_WSGI_HOST
            if hasattr(settings, 'TEST_WSGI_PORT'):
                defaults['port'] = settings.TEST_WSGI_PORT
            django_server = DjangoThread(**defaults)
            django_server.start()

        setup_test_environment()
        settings.DEBUG = False
Example #2
0
    def __init__(self, verbosity=1, interactive=True, failfast=False, **kwargs):
        DjangoTestSuiteRunner.__init__(self,  verbosity, interactive, failfast, **kwargs)
        self.test_module = getattr(settings, 'WSGI_TEST_MODULE', 'tests.itest')
        self.db_prefix = getattr(settings, "DB_PREFIX", '_TESTDB')
        self.reuse_db = getattr(settings, "REUSE_TEST_DB", False)
        self.wsgi_starts = getattr(settings, "TEST_WSGI_START", True)
        from django.test import simple
        simple.TEST_MODULE = self.test_module

        print 'Starting django wsgi server.'
        defaults = {}
        if hasattr(settings, 'TEST_WSGI_HOST'):
            defaults['host'] = settings.TEST_WSGI_HOST
        if hasattr(settings, 'TEST_WSGI_PORT'):
            defaults['port'] = settings.TEST_WSGI_PORT
        django_server = DjangoThread(**defaults)
        django_server.start()