Ticket #13007: 13007_testcase.diff

File 13007_testcase.diff, 955 bytes (added by Ubercore, 14 years ago)

Test illustrating the cookie issue

  • tests/regressiontests/httpwrappers/tests.py

     
    11import copy
    22import pickle
    33
    4 from django.http import QueryDict, HttpResponse, CompatCookie, BadHeaderError
     4from django.http import QueryDict, HttpResponse, CompatCookie, BadHeaderError, \
     5                        parse_cookie
    56from django.utils import unittest
    67
    78class QueryDictTests(unittest.TestCase):
     
    264265        c2 = CompatCookie()
    265266        c2.load(c.output())
    266267        self.assertEqual(c['test'].value, c2['test'].value)
     268   
     269    def test_nonstandard_keys(self):
     270        """
     271        Test that a single non-standard cookie name doesn't affect all cookies.
     272        """
     273        self.assert_('good_cookie' in parse_cookie('good_cookie=yes;bad:cookie=yes').keys())
Back to Top