Modify ↓
#12446 closed enhancement (fixed)
Add as_int and as_bool methods to the DetachedSession class
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.2 |
Component: | web frontend | Version: | |
Severity: | normal | Keywords: | session |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: |
Added |
||
Internal Changes: |
Description
Similar to #12426, I propose adding as_int
and as_bool
to the DetachedSession
class.
Attachments (0)
Change History (5)
comment:1 by , 9 years ago
API Changes: | modified (diff) |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in [14707].
comment:3 by , 9 years ago
2 failures in https://travis-ci.org/edgewall/trac/builds/122104248.
====================================================================== ERROR: test_as_bool (trac.web.tests.session.SessionTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/travis/build/edgewall/trac/trac/web/tests/session.py", line 214, in test_as_bool """) File "/home/travis/build/edgewall/trac/trac/db/util.py", line 128, in execute cursor.execute(query, params if params is not None else []) File "/home/travis/build/edgewall/trac/trac/db/util.py", line 63, in execute r = self.cursor.execute(sql) File "/home/travis/build/edgewall/trac/trac/db/sqlite_backend.py", line 87, in execute result = PyFormatCursor.execute(self, *args) File "/home/travis/build/edgewall/trac/trac/db/sqlite_backend.py", line 63, in execute args or []) File "/home/travis/build/edgewall/trac/trac/db/sqlite_backend.py", line 54, in _rollback_on_error return function(self, *args, **kwargs) OperationalError: near ",": syntax error ====================================================================== ERROR: test_as_int (trac.web.tests.session.SessionTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/travis/build/edgewall/trac/trac/web/tests/session.py", line 195, in test_as_int """) File "/home/travis/build/edgewall/trac/trac/db/util.py", line 128, in execute cursor.execute(query, params if params is not None else []) File "/home/travis/build/edgewall/trac/trac/db/util.py", line 63, in execute r = self.cursor.execute(sql) File "/home/travis/build/edgewall/trac/trac/db/sqlite_backend.py", line 87, in execute result = PyFormatCursor.execute(self, *args) File "/home/travis/build/edgewall/trac/trac/db/sqlite_backend.py", line 63, in execute args or []) File "/home/travis/build/edgewall/trac/trac/db/sqlite_backend.py", line 54, in _rollback_on_error return function(self, *args, **kwargs) OperationalError: near ",": syntax error
Multi-values insert is available since sqlite 3.7.11. SQLite on Travis CI is 3.7.9.
207 def test_as_bool(self): 208 with self.env.db_transaction as db: 209 db("INSERT INTO session VALUES ('123456', 1, 0)") 210 db(""" 211 INSERT INTO session_attribute VALUES 212 ('123456', 1, 'foo', 'bar'), 213 ('123456', 1, 'baz', 1) 214 """) 215
sqlite3 : 2.4.1 (3.7.9)
comment:4 by , 9 years ago
Note:
See TracTickets
for help on using tickets.
Proposed changes in log:rjollos.git:t12446_session_as_methods.1.