def main(argv): parser = create_parser() arguments = parser.parse_args(argv) os.environ.setdefault("CORRAL_SETTINGS_MODULE", arguments.settings) from corral import core, conf, db # SETUP THE ENVIRONMENT if arguments.verbosity < 3: conf.settings.DEBUG = False core.setup_environment() db.create_all() core.logger.setLevel(core.logging.CRITICAL) # RUN THE TESTS result = run_tests(verbosity=arguments.verbosity, failfast=arguments.failfast) # EXIT WITH CORRECT STATUS sys.exit(not result.wasSuccessful())
def main(argv): parser = create_parser() arguments = parser.parse_args(argv) os.environ.setdefault("CORRAL_SETTINGS_MODULE", arguments.settings) from corral import core, conf, db # SETUP THE ENVIRONMENT if arguments.verbosity < 3: conf.settings.DEBUG = False core.setup_environment() db.create_all() core.logger.setLevel(core.logging.CRITICAL) # RUN THE TESTS result = run_tests( verbosity=arguments.verbosity, failfast=arguments.failfast) # EXIT WITH CORRECT STATUS sys.exit(not result.wasSuccessful())
def load_ipython_extension(ipython): from corral import core core.setup_environment()
def test_setup_environment(self): with mock.patch("corral.db.setup") as setup: with mock.patch("corral.db.load_models_module") as load_mm: core.setup_environment() self.assertTrue(setup.called) self.assertTrue(load_mm.called)
USE_TZ = True SITE_ID = 1 ACCOUNT_ACTIVATION_DAYS = 2 REGISTRATION_OPEN = False LOGIN_REDIRECT_URL = '/' # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.9/howto/static-files/ STATIC_URL = '/static/' BOOTSTRAP3 = { 'theme_url': 'https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/journal/bootstrap.min.css', } # corral conf os.environ.setdefault("CORRAL_SETTINGS_MODULE", "carpyncho.settings") from corral import core core.setup_environment() from local_settings import *