devtools-request: transmit the headers keyword argument to the request class
Otherwise the headers kwargs end up in the form.
This is very useful for testing publish logic related to http header (as cache).
--- a/devtools/testlib.py Thu Mar 15 17:59:27 2012 +0100
+++ b/devtools/testlib.py Fri Mar 16 14:23:58 2012 +0100
@@ -592,9 +592,9 @@
return publisher
requestcls = fake.FakeRequest
- def request(self, rollbackfirst=False, url=None, **kwargs):
+ def request(self, rollbackfirst=False, url=None, headers={}, **kwargs):
"""return a web ui request"""
- req = self.requestcls(self.vreg, url=url, form=kwargs)
+ req = self.requestcls(self.vreg, url=url, headers=headers, form=kwargs)
if rollbackfirst:
self.websession.cnx.rollback()
req.set_session(self.websession)