Ejemplo n.º 1
0
 def setUpClass(cls):
     cls.app = create_app('altUI', "")
     cls.app_context = cls.app.app_context()
     cls.app_context.push()
     db.create_all()
     # save the current timestamp to the database to avoid hanging cached
     # data
     save_config_timestamp()
     db.session.commit()
Ejemplo n.º 2
0
 def setUpClass(cls):
     cls.app = create_app('testing', "")
     cls.app_context = cls.app.app_context()
     cls.app_context.push()
     db.create_all()
     # save the current timestamp to the database to avoid hanging cached
     # data
     save_config_timestamp()
     db.session.commit()
     # Create an admin for tests.
     create_db_admin(cls.app, "testadmin", "*****@*****.**", "testpw")
Ejemplo n.º 3
0
 def setUpClass(cls):
     cls.app = create_app('testing', "")
     cls.app_context = cls.app.app_context()
     cls.app_context.push()
     db.create_all()
     # save the current timestamp to the database to avoid hanging cached
     # data
     save_config_timestamp()
     db.session.commit()
     # Create an admin for tests.
     create_db_admin(cls.app, "testadmin", "*****@*****.**", "testpw")
Ejemplo n.º 4
0
 def setUpClass(cls):
     # Modified setup method to use SharedEngineRegistry
     cls.app = create_app('testing', "")
     cls.app.config['PI_ENGINE_REGISTRY_CLASS'] = 'shared'
     cls.app_context = cls.app.app_context()
     cls.app_context.push()
     db.create_all()
     # save the current timestamp to the database to avoid hanging cached
     # data
     save_config_timestamp()
     db.session.commit()
     # Create an admin for tests.
     create_db_admin(cls.app, "testadmin", "*****@*****.**", "testpw")
Ejemplo n.º 5
0
 def test_09_invalidate_config_object(self):
     # Test manual invalidation of the config object
     # Ensure we have a config object
     get_config_object()
     # Add a config option *without invalidating the config*
     db.session.add(Config(Key=u"some_key", Value=u"some_value"))
     save_config_timestamp(False)
     db.session.commit()
     # The request-local config does not know about the new config option
     self.assertEqual(get_from_config("some_key", "default"), "default")
     # ... so we manually invalidate it ...
     invalidate_config_object()
     # ... and the new config object knows!
     self.assertEqual(get_from_config("some_key", "default"), "some_value")