On Wed, 29 Sep 2010 13:00 +0000, exarkun@twistedmatrix.com wrote:
On 12:48 pm, peter.westlake@pobox.com wrote: ...
class FakeRequest(nevow.testutil.FakeRequest): def getResponseHeader(self, key): return self.headers.get(key.lower())
Should I put in a ticket requesting something like this?
Certainly. Things are a little mixed up here though, let's see...
Twisted Web provides a base Request class. Nevow subclasses it to create the request class all Nevow applications get. Then Twisted Web also provides a FakeRequest, which isn't very good, and I think there is a ticket (in the Twisted tracker) for improving. Then Nevow provides its own FakeRequest, not a subclass of Twisted's FakeRequest. There probably needs to be a Nevow ticket for doing something about Nevow's FakeRequest class - in the short term, fixing these minor issues; but in the longer term, getting rid of it, and hopefully NevowRequest as well, makes a lot of sense.
The ticket for set/getHeader is http://divmod.org/trac/ticket/3029. Getting rid of NevowRequest and Nevow's FakeRequest presumably means adding their extra functionality to the ones in Twisted Web, so would that ticket go into Nevow, Twisted, or both? Peter.