summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2010-05-28 16:39:52 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2010-05-28 16:39:52 +0000
commit3180f932369e3a6a1604c5ea98ee7063eeeaf1dd (patch)
tree9f3d49031182487a08d7c328a346f416161f9bdb /tests
parent8a10078a0397858a080079b77fe936ccbe677cea (diff)
Fixed #13572: copies of QueryDicts now have their encoding set correctly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/httpwrappers/tests.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py
index 6821bb3c21..23aa526a37 100644
--- a/tests/regressiontests/httpwrappers/tests.py
+++ b/tests/regressiontests/httpwrappers/tests.py
@@ -1,5 +1,6 @@
-import unittest
+import copy
import pickle
+import unittest
from django.http import QueryDict, HttpResponse, CompatCookie, BadHeaderError
class QueryDictTests(unittest.TestCase):
@@ -182,6 +183,19 @@ class QueryDictTests(unittest.TestCase):
x.update(y)
self.assertEqual(x.getlist('a'), [u'1', u'2', u'3', u'4'])
+ def test_non_default_encoding(self):
+ """#13572 - QueryDict with a non-default encoding"""
+ q = QueryDict('sbb=one', encoding='rot_13')
+ self.assertEqual(q.encoding , 'rot_13' )
+ self.assertEqual(q.items() , [(u'foo', u'bar')] )
+ self.assertEqual(q.urlencode() , 'sbb=one' )
+ q = q.copy()
+ self.assertEqual(q.encoding , 'rot_13' )
+ self.assertEqual(q.items() , [(u'foo', u'bar')] )
+ self.assertEqual(q.urlencode() , 'sbb=one' )
+ self.assertEqual(copy.copy(q).encoding , 'rot_13' )
+ self.assertEqual(copy.deepcopy(q).encoding , 'rot_13')
+
class HttpResponseTests(unittest.TestCase):
def test_unicode_headers(self):
r = HttpResponse()