Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.5.x] Fixed httpwrappers tests under hash randomization

Backport of 195bc37 from master
  • Loading branch information...
commit 1b4b0dc01381d88d5c2e42ed5c91786e82ae1255 1 parent fbb6640
@aaugustin aaugustin authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 tests/regressiontests/httpwrappers/tests.py
View
6 tests/regressiontests/httpwrappers/tests.py
@@ -149,7 +149,7 @@ def test_basic_mutable_operations(self):
self.assertEqual(q.setdefault('foo', 'bar'), 'bar')
self.assertEqual(q['foo'], 'bar')
self.assertEqual(q.getlist('foo'), ['bar'])
- self.assertEqual(q.urlencode(), 'foo=bar&name=john')
+ self.assertIn(q.urlencode(), ['foo=bar&name=john', 'name=john&foo=bar'])
q.clear()
self.assertEqual(len(q), 0)
@@ -266,14 +266,18 @@ def test_headers_type(self):
# The response also converts unicode or bytes keys to strings, but requires
# them to contain ASCII
r = HttpResponse()
+ del r['Content-Type']
r['foo'] = 'bar'
l = list(r.items())
+ self.assertEqual(len(l), 1)
self.assertEqual(l[0], ('foo', 'bar'))
self.assertIsInstance(l[0][0], str)
r = HttpResponse()
+ del r['Content-Type']
r[b'foo'] = 'bar'
l = list(r.items())
+ self.assertEqual(len(l), 1)
self.assertEqual(l[0], ('foo', 'bar'))
self.assertIsInstance(l[0][0], str)
Please sign in to comment.
Something went wrong with that request. Please try again.