| 144 | """Session test with db store.""" |
| 145 | |
| 146 | def make_session(self, app): |
| 147 | if os.path.exists("webpy.db"): |
| 148 | os.remove("webpy.db") |
| 149 | |
| 150 | db = web.database(dbn="sqlite", db="webpy.db") |
| 151 | # db.printing = True |
| 152 | db.query( |
| 153 | "" |
| 154 | + "CREATE TABLE session (" |
| 155 | + " session_id char(128) unique not null," |
| 156 | + " atime timestamp default (datetime('now','utc'))," |
| 157 | + " data text)" |
| 158 | ) |
| 159 | store = web.session.DBStore(db, "session") |
| 160 | return web.session.Session(app, store, {"count": 0}) |
| 161 | |
| 162 | |
| 163 | class MemorySessionTest(SessionTest): |