def setUp(self): self.config = config.Config(self.TEST_CONFIG, mode='dev') self.server = server.WWWServer(self.config, port=8888) super().setUp() self.db = self.server.db_factory.create() self.admin_id = self.db.add_default_admin() self.icu_id = self.db.add_icu(self.admin_id, store.ICU(name='icu')) self.user_id = self.db.add_user_to_icu( self.admin_id, self.icu_id, store.User(name='user', consent=True, is_active=True)) self.user = self.db.get_user(self.user_id) self.icu = self.db.get_icu(self.icu_id)
def get_app(self): www_server = server.WWWServer(self.config, port=8888) return www_server.make_app(cookie_secret='secret')