(self)
| 377 | self.assertEqual(x.a, 2) |
| 378 | |
| 379 | def test_changequery(self): |
| 380 | urls = ("/", "index") |
| 381 | |
| 382 | class index: |
| 383 | def GET(self): |
| 384 | return web.changequery(x=1) |
| 385 | |
| 386 | app = web.application(urls, locals()) |
| 387 | |
| 388 | def f(path): |
| 389 | return app.request(path).data |
| 390 | |
| 391 | self.assertEqual(f("/?x=2"), b"/?x=1") |
| 392 | |
| 393 | p = f("/?y=1&y=2&x=2") |
| 394 | self.assertTrue(p in {b"/?y=1&y=2&x=1", b"/?x=1&y=1&y=2"}) |
| 395 | |
| 396 | def test_setcookie(self): |
| 397 | urls = ("/", "index") |