1 | | If I was implementing `MockRequest` now, I would have added a property `response_sent` that returned the value from the buffer, to avoid accessing as `req.response_sent.getvalue()`. Like what is done here: [browser:trunk/trac/web/tests/api.py@16656:106-108#L88]. |
| 1 | If I was implementing `MockRequest` now, I would have add a property `response_sent` that returned the value from the buffer, to avoid accessing as `req.response_sent.getvalue()`. See for example what is done here: [browser:trunk/trac/web/tests/api.py@16656:106-108#L88]. However, `Request.response_sent` is an attribute and changing it to a property would be an API change. |
| 2 | |
| 3 | I suppose we could added an accessor such as `get_response()`, but I tend to think it confuses more than helps to have multiple public attributes and functions for accessing the same data. |