diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-10-26 22:09:48 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-10-26 22:09:48 +0200 |
| commit | 195bc37f1d251eb7b5bc4d5f916f3b08745a504f (patch) | |
| tree | cca99459a3eca48b0c57cca5c5d44ecf5524852d | |
| parent | be29329ccd49a84d3f7238111aebf97c4aaac581 (diff) | |
Fixed httpwrappers tests under hash randomization
| -rw-r--r-- | tests/regressiontests/httpwrappers/tests.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py index 553b6ecff4..2d172ad0e0 100644 --- a/tests/regressiontests/httpwrappers/tests.py +++ b/tests/regressiontests/httpwrappers/tests.py @@ -149,7 +149,7 @@ class QueryDictTests(unittest.TestCase): 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 @@ class HttpResponseTests(unittest.TestCase): # 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) |
