diff --git a/tests/fallback_encoding_msie/__init__.py b/tests/fallback_encoding_msie/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/fallback_encoding_msie/models.py b/tests/fallback_encoding_msie/models.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/fallback_encoding_msie/tests.py b/tests/fallback_encoding_msie/tests.py
new file mode 100644
index 0000000..892da05
-
|
+
|
|
| 1 | # -*- coding: utf-8 -*- |
| 2 | from __future__ import unicode_literals |
| 3 | try: |
| 4 | from urllib import unquote |
| 5 | except ImportError: |
| 6 | from urllib.parse import unquote |
| 7 | |
| 8 | from django.test.client import Client |
| 9 | from django.test import TestCase |
| 10 | |
| 11 | |
| 12 | class IEClient(Client): |
| 13 | def request(self, **kwargs): |
| 14 | try: |
| 15 | kwargs['QUERY_STRING'] = unquote(kwargs['QUERY_STRING']) |
| 16 | except: |
| 17 | pass |
| 18 | return super(IEClient, self).request(**kwargs) |
| 19 | |
| 20 | |
| 21 | class IETestCase(TestCase): |
| 22 | client_class = IEClient |
| 23 | |
| 24 | |
| 25 | class TestFallbackEncodingMSIE(IETestCase): |
| 26 | '''Describes issue related to MSIE and GET parameters, issue #22721''' |
| 27 | |
| 28 | urls = 'tests.fallback_encoding_msie.urls' |
| 29 | |
| 30 | def test_query_string_msie(self): |
| 31 | qs = {'q': 'æøåÆØÅ'} |
| 32 | response = self.client.get('/fallback-encoding-msie/', qs) |
| 33 | self.assertEqual(200, response.status_code) |
diff --git a/tests/fallback_encoding_msie/urls.py b/tests/fallback_encoding_msie/urls.py
new file mode 100644
index 0000000..5e8b1ac
-
|
+
|
|
| 1 | # -*- coding: utf-8 -*- |
| 2 | from __future__ import unicode_literals |
| 3 | |
| 4 | from django.conf.urls import patterns |
| 5 | |
| 6 | from .views import simple_view |
| 7 | |
| 8 | urlpatterns = patterns('', |
| 9 | (r'^fallback-encoding-msie/$', simple_view), |
| 10 | ) |
diff --git a/tests/fallback_encoding_msie/views.py b/tests/fallback_encoding_msie/views.py
new file mode 100644
index 0000000..7484aac
-
|
+
|
|
| 1 | # -*- coding: utf-8 -*- |
| 2 | from __future__ import unicode_literals |
| 3 | |
| 4 | from django.http import HttpResponse |
| 5 | |
| 6 | |
| 7 | def simple_view(request): |
| 8 | return HttpResponse(request.GET['q']) |