Example #1
0
 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
Example #3
0
    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
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 def get_routes(self):
     env = Environment()
     settings = Settings(env.get_settings(), _prefix="forecast.tests.")
     return Routes(settings)
Example #7
0
 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)
Example #8
0
 def get_settings(self, environment="base"):
     env = Environment(environment)
     return Settings(env.get_settings(), _prefix="forecast.tests.")
Example #9
0
 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())