[1.7.x] Adapted invalid cookie test to all Python versions

Refs #23638. Older Python versions are less strict when parsing
invalid cookie content. The test just has to ensure Django doesn't
crash.
This commit is contained in:
Claude Paroz 2014-10-14 09:26:13 +02:00
parent 6398ebab93
commit 555952c3e6
1 changed files with 4 additions and 1 deletions

View File

@ -88,7 +88,10 @@ class HandlerTests(TestCase):
environ = RequestFactory().get('/').environ
environ['HTTP_COOKIE'] = 'x=W\x03c(h]\x8e'
request = WSGIRequest(environ)
self.assertEqual(request.COOKIES, {})
# We don't test COOKIES content, as the result might differ between
# Python version because parsing invalid content became stricter in
# latest versions.
self.assertIsInstance(request.COOKIES, dict)
class TransactionsPerRequestTests(TransactionTestCase):