Ticket #1721: turbogears-sqlalchemy-0.4-rollback-test.patch
| File turbogears-sqlalchemy-0.4-rollback-test.patch, 1.2 kB (added by toshio, 5 months ago) |
|---|
-
TurboGears-1.0.4.3/turbogears/tests/test_sqlalchemy.py
old new 158 158 doerr = errorhandling.exception_handler(handerr)(doerr) 159 159 doerr = expose()(doerr) 160 160 161 def handexc(self, id): 162 Person(id=id) 163 try: 164 Person(id=id) 165 except: 166 pass 167 handexc = expose()(handexc) 168 161 169 def test_exc_rollback(): 162 170 cherrypy.root = RbRoot() 163 171 create_request('/doerr?id=24') … … 172 180 print cherrypy.response.body[0] 173 181 assert cherrypy.response.body[0] == '{"tg_flash": null}' 174 182 183 # Check that if the controller method catches a db exception, we don't still 184 # raise an exception 185 def test_exc_caught_rollback(): 186 cherrypy.root = RbRoot() 187 create_request('/handexc?id=27') 188 output = cherrypy.response.body[0] 189 print output 190 assert '<title>500 Internal error</title>' not in output 191 175 192 #-- 176 193 # Check for session freshness, ticket #1419 177 194 # It checks that changes made to the data in thread B are reflected in thread A.