summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGael Pasgrimaud <gael@gawel.org>2014-04-16 21:55:44 +0200
committerGael Pasgrimaud <gael@gawel.org>2014-04-16 21:55:44 +0200
commit6a0435bb75ca02f3dac157f06b49b757aede04d9 (patch)
tree80114fe0abc4f0536d41acf4fb1a81c66b2099dd
parent7e5e556d3d1830813446b2bf055a615e1675a48b (diff)
downloadwebtest-6a0435bb75ca02f3dac157f06b49b757aede04d9.tar.gz
Fixed #89
-rw-r--r--CHANGELOG.rst5
-rw-r--r--tests/test_app.py12
-rw-r--r--webtest/app.py8
3 files changed, 6 insertions, 19 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index a1b9ec3..4e3cf86 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -7,6 +7,10 @@ News
- Fixed #73. Python < 2.6.5 does not support unicode as keyword arguments names.
[Stepan Kolesnik]
+- Fixed #89 remove WSGIWarning: You are not supposed to send a body in a DELETE
+ request because we now have a good reason for that. See http://bit.ly/1tb3yxW
+ [gawel]
+
- Fixed #92 You can now override TestApp.JSONEncoder to use a custom encoder
[gawel]
@@ -20,6 +24,7 @@ News
[gawel]
- Fixed #108 cgi.parse_qsl is pending deprecation
+ [gawel]
2.0.14 (2014-01-23)
-------------------
diff --git a/tests/test_app.py b/tests/test_app.py
index a59dd7c..8352b93 100644
--- a/tests/test_app.py
+++ b/tests/test_app.py
@@ -12,7 +12,6 @@ import os
import six
import mock
import webtest
-import warnings
class TestApp(unittest.TestCase):
@@ -65,17 +64,6 @@ class TestApp(unittest.TestCase):
resp = self.app.get('/?a=b&c=d', dict(e='f'))
resp.mustcontain('a=b', 'c=d', 'e=f')
- def test_delete_params_warning(self):
- with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter("always")
- self.app.delete('/')
- self.assertEqual(len(w), 0, "We should not have any warnings")
- self.app.delete('/', params=dict(a=1))
- self.assertEqual(len(w), 1, "We should have one warning")
- self.assertTrue(
- "DELETE" in str(w[-1].message),
- "The warning message should say something about DELETE")
-
def test_request_with_testrequest(self):
req = webtest.TestRequest.blank('/')
resp = self.app.request(req, method='POST')
diff --git a/webtest/app.py b/webtest/app.py
index 7d6eb79..40a7723 100644
--- a/webtest/app.py
+++ b/webtest/app.py
@@ -14,7 +14,6 @@ import re
import json
import random
import fnmatch
-import warnings
import mimetypes
from base64 import b64encode
@@ -339,7 +338,7 @@ class TestApp(object):
expect_errors=expect_errors,
content_type=content_type)
- def delete(self, url, params=utils.NoDefault, headers=None,
+ def delete(self, url, params='', headers=None,
extra_environ=None, status=None, expect_errors=False,
content_type=None, xhr=False):
"""
@@ -622,11 +621,6 @@ class TestApp(object):
Do a generic request.
"""
- if method == 'DELETE' and params is not utils.NoDefault:
- warnings.warn(('You are not supposed to send a body in a '
- 'DELETE request. Most web servers will ignore it'),
- lint.WSGIWarning)
-
environ = self._make_environ(extra_environ)
inline_uploads = []