1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Removed custom WSGIRequestHandler.get_environ

We probably historically customized it for good reasons, but
currently, the differences with upstream Python are not
significant any longer.
Also fixes #19075 for which a test has been added.
This commit is contained in:
Claude Paroz
2012-10-20 12:34:50 +02:00
parent 3084b1cfd6
commit 681550ca6d
4 changed files with 16 additions and 35 deletions

View File

@@ -1,6 +1,9 @@
# -*- encoding: utf-8 -*-
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import os
try:
from urllib.request import urlopen, HTTPError
@@ -11,6 +14,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.test import LiveServerTestCase
from django.core.servers.basehttp import WSGIServerException
from django.test.utils import override_settings
from django.utils.http import urlencode
from .models import Person
@@ -134,6 +138,10 @@ class LiveServerViews(LiveServerBase):
f = self.urlopen('/media/example_media_file.txt')
self.assertEqual(f.read().rstrip(b'\r\n'), b'example media file')
def test_environ(self):
f = self.urlopen('/environ_view/?%s' % urlencode({'q': 'тест'}))
self.assertIn(b"QUERY_STRING: 'q=%D1%82%D0%B5%D1%81%D1%82'", f.read())
class LiveServerDatabase(LiveServerBase):