Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
TestApp.delete causes spurious warning #50
webtest/app.py:550: WSGIWarning: You are not supposed to send a body in a DELETE request. Most web servers will ignore it
This is caused by a test that checks if params is not NoDefault, but the default value is u'' instead of NoDefault.
(Side note: using the stacklevel param of warnings.warn will cause the traceback to show the line that called the function, not the line of the function that calls warn).
Workflow is the following:
On Mon, Mar 4, 2013 at 6:40 AM, Éric Araujo firstname.lastname@example.org:
Yep, I know the basic flow as I said in my previous message, it’s really the branching model and the synchronization that don’t fit my head yet.
I did that and it does remove the spurious warning for DELETE.
Problem is that warnings use their own reporting system, so you can’t just use assertRaises. In the stdlib we have special helpers to check that a warning was sent, but there’s nothing to do that in webtest at present.
stacklevel=3 does the right thing (3 = _gen_request → delete method → caller). I wanted to separate the two changes in two commits and then git hated me so I won’t push anything today, but I wanted to confirm the fixes.