Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
| File test.patch,
1.5 KB
(added by Joost, 5 years ago) |
|
test
|
-
|
|
|
|
| 162 | 162 | flash_redirected = turbogears.expose(html=".simple", |
| 163 | 163 | allow_json=True)(flash_redirected) |
| 164 | 164 | |
| | 165 | def flash_with_commas(self): |
| | 166 | turbogears.flash("Foo,Bar") |
| | 167 | return dict(title="Foobar", mybool=False, someval="niggles") |
| | 168 | flash_with_commas = turbogears.expose(html=".simple", |
| | 169 | allow_json=True)(flash_with_commas) |
| 165 | 170 | |
| | 171 | |
| 166 | 172 | class TestRoot(unittest.TestCase): |
| 167 | 173 | def setUp(self): |
| 168 | 174 | cherrypy.root = None |
| … |
… |
|
| 357 | 363 | assert values["tg_flash"]=="plain" |
| 358 | 364 | assert not cherrypy.response.simple_cookie.has_key("tg_flash") |
| 359 | 365 | |
| | 366 | def test_flash_with_commas(self): |
| | 367 | "turbogears.flash with strings that contain commas should work" |
| | 368 | # Trac ticket 1164: The turbogears.flash() function doesn't work |
| | 369 | # ... if the message string contains a comma (",") character. |
| | 370 | testutil.createRequest("/flash_with_commas?tg_format=json") |
| | 371 | import simplejson |
| | 372 | values = simplejson.loads(cherrypy.response.body[0]) |
| | 373 | assert values["tg_flash"]=="Foo,Bar", values["tg_flash"] |
| | 374 | assert not cherrypy.response.simple_cookie.has_key("tg_flash") |
| | 375 | |
| 360 | 376 | def test_flash_unicode(self): |
| 361 | 377 | "turbogears.flash with unicode objects should work" |
| 362 | 378 | testutil.createRequest("/flash_unicode?tg_format=json") |
Download in other formats: