mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #30677 -- Improved error message for urlencode() and Client when None is passed as data.
This commit is contained in:
parent
c1b26c77a9
commit
73ac9e3f04
4 changed files with 13 additions and 12 deletions
|
@ -61,8 +61,8 @@ class ClientTest(TestCase):
|
|||
|
||||
def test_get_data_none(self):
|
||||
msg = (
|
||||
'Cannot encode None in a query string. Did you mean to pass an '
|
||||
'empty string or omit the value?'
|
||||
"Cannot encode None for key 'value' in a query string. Did you "
|
||||
"mean to pass an empty string or omit the value?"
|
||||
)
|
||||
with self.assertRaisesMessage(TypeError, msg):
|
||||
self.client.get('/get_view/', {'value': None})
|
||||
|
@ -102,8 +102,8 @@ class ClientTest(TestCase):
|
|||
|
||||
def test_post_data_none(self):
|
||||
msg = (
|
||||
'Cannot encode None as POST data. Did you mean to pass an empty '
|
||||
'string or omit the value?'
|
||||
"Cannot encode None for key 'value' as POST data. Did you mean "
|
||||
"to pass an empty string or omit the value?"
|
||||
)
|
||||
with self.assertRaisesMessage(TypeError, msg):
|
||||
self.client.post('/post_view/', {'value': None})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue