Exemplo n.º 1
0
 def setUp(self):
     SkygearContainer.set_default_app_name(self.app_name)
     with db.conn() as conn:
         conn.execute("CREATE SCHEMA IF NOT EXISTS app_{0}".format(
             self.app_name))
         conn.execute("""
             CREATE TABLE IF NOT EXISTS _user (
                 id text PRIMARY KEY,
                 username text,
                 email text,
                 password text,
                 auth jsonb
             );""")
         sql = text("""
             INSERT INTO _user (id, username, password)
             VALUES (:id, :username, :password);
             """)
         conn.execute(sql,
                      id='1',
                      username='******',
                      password=u.hash_password('supersecret1'))
Exemplo n.º 2
0
 def setUp(self):
     SkygearContainer.set_default_app_name(self.app_name)
     with db.conn() as conn:
         conn.execute("CREATE SCHEMA IF NOT EXISTS app_{0}"
                      .format(self.app_name))
         conn.execute("""
             CREATE TABLE IF NOT EXISTS _user (
                 id text PRIMARY KEY,
                 username text,
                 email text,
                 password text,
                 auth jsonb
             );""")
         sql = text("""
             INSERT INTO _user (id, username, password)
             VALUES (:id, :username, :password);
             """)
         conn.execute(sql,
                      id='1',
                      username='******',
                      password=u.hash_password('supersecret1'))
Exemplo n.º 3
0
 def setUp(self):
     SkygearContainer.set_default_app_name(self.app_name)
     with db.conn() as conn:
         conn.execute("CREATE SCHEMA IF NOT EXISTS \"app_{0}\""
                      .format(self.app_name))
         conn.execute(
             "set search_path to \"app_{0}\", public;".format(
                 self.app_name
             )
         )
         conn.execute("""
             CREATE TABLE IF NOT EXISTS note (
                 id text PRIMARY KEY,
                 content text
             );""")
         sql = text("""
             INSERT INTO note (id, content)
             VALUES (:id, :content);
             """)
         conn.execute(sql,
                      id='first',
                      content='Hello World!')
Exemplo n.º 4
0
 def setUp(self):
     SkygearContainer.set_default_app_name(self.app_name)
     with db.conn() as conn:
         conn.execute("CREATE SCHEMA IF NOT EXISTS \"app_{0}\""
                      .format(self.app_name))
         conn.execute(
             "set search_path to \"app_{0}\", public;".format(
                 self.app_name
             )
         )
         conn.execute("""
             CREATE TABLE IF NOT EXISTS note (
                 id text PRIMARY KEY,
                 content text
             );""")
         sql = text("""
             INSERT INTO note (id, content)
             VALUES (:id, :content);
             """)
         conn.execute(sql,
                      id='first',
                      content='Hello World!')