mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[2.1.x] Fixed #29627 -- Fixed QueryDict.urlencode() crash with non-string values.
Regression in7d96f0c49a. Backport ofd8e2be459ffrom master
This commit is contained in:
		| @@ -114,6 +114,13 @@ class QueryDictTests(SimpleTestCase): | ||||
|         self.assertEqual(q.urlencode(), 'next=%2Ft%C3%ABst%26key%2F') | ||||
|         self.assertEqual(q.urlencode(safe='/'), 'next=/t%C3%ABst%26key/') | ||||
|  | ||||
|     def test_urlencode_int(self): | ||||
|         # Normally QueryDict doesn't contain non-string values but lazily | ||||
|         # written tests may make that mistake. | ||||
|         q = QueryDict(mutable=True) | ||||
|         q['a'] = 1 | ||||
|         self.assertEqual(q.urlencode(), 'a=1') | ||||
|  | ||||
|     def test_mutable_copy(self): | ||||
|         """A copy of a QueryDict is mutable.""" | ||||
|         q = QueryDict().copy() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user