def test_tornado_app_settings(self): env = Environment("base") settings = Settings(env.get_settings(), _prefix="forecast.tests.") project = self.get_project(settings=settings) project.install_applications() app = project.get_tornado_application() self.assertIn("debug", app.settings)
def test_base_environment_settings(self): argv = sys.argv[:] sys.argv = [] env = Environment() self.assertListEqual(["settings.base"], env.get_settings()) sys.argv = argv
def test_run_dummy_command_in_project(self): environment = Environment() settings = Settings(environment.get_settings(), _prefix="forecast.tests.") project = self.get_project(settings=settings) argv = sys.argv sys.argv = ["./manage.py", "cmd"] self.assertEqual("ok", project.run()) sys.argv = argv
def test_fail_incorrect_application_spec_in_settings(self): env = Environment("invalid_app_spec") settings = Settings(env.get_settings(), _prefix="forecast.tests.") project = self.get_project(settings=settings) self.assertRaises(SettingsError, project.install_applications)
def test_install_applications_in_settings(self): environment = Environment() settings = Settings(environment.get_settings(), _prefix="forecast.tests.") project = self.get_project(settings=settings) project.install_applications() self.assertIn("forecast.tests.test_app", project.applications)
def get_routes(self): env = Environment() settings = Settings(env.get_settings(), _prefix="forecast.tests.") return Routes(settings)
def test_required_core_app(self): env = Environment("base") settings = Settings(env.get_settings(), _prefix="forecast.tests.") project = self.get_project(settings=settings) project.install_applications() self.assertIn("forecast.applications.core", project.applications)
def get_settings(self, environment="base"): env = Environment(environment) return Settings(env.get_settings(), _prefix="forecast.tests.")
def get_manager(self): env = Environment() settings = Settings(env.get_settings(), _prefix="forecast.tests.") return Manager(settings)
def test_dev_environment_settings(self): env = Environment("dev") self.assertListEqual(["settings.base", "settings.dev"], env.get_settings())