~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to tests/regressiontests/wsgi/tests.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone, Jakub Wilk, Luke Faraone
  • Date: 2013-05-09 15:10:47 UTC
  • mfrom: (1.1.21) (4.4.27 sid)
  • Revision ID: package-import@ubuntu.com-20130509151047-aqv8d71oj9wvcv8c
Tags: 1.5.1-2
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Luke Faraone ]
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from __future__ import with_statement
 
1
from __future__ import unicode_literals
2
2
 
3
3
from django.core.exceptions import ImproperlyConfigured
4
4
from django.core.servers.basehttp import get_internal_wsgi_application
6
6
from django.test import TestCase
7
7
from django.test.client import RequestFactory
8
8
from django.test.utils import override_settings
9
 
from django.utils import unittest
 
9
from django.utils import six, unittest
10
10
 
11
11
 
12
12
class WSGITest(TestCase):
39
39
            response_data["headers"],
40
40
            [('Content-Type', 'text/html; charset=utf-8')])
41
41
        self.assertEqual(
42
 
            unicode(response),
43
 
            u"Content-Type: text/html; charset=utf-8\n\nHello World!")
 
42
            bytes(response),
 
43
            b"Content-Type: text/html; charset=utf-8\r\n\r\nHello World!")
44
44
 
45
45
 
46
46
class GetInternalWSGIApplicationTest(unittest.TestCase):
83
83
 
84
84
    @override_settings(WSGI_APPLICATION="regressiontests.wsgi.noexist.app")
85
85
    def test_bad_module(self):
86
 
        with self.assertRaisesRegexp(
 
86
        with six.assertRaisesRegex(self,
87
87
            ImproperlyConfigured,
88
88
            r"^WSGI application 'regressiontests.wsgi.noexist.app' could not be loaded; could not import module 'regressiontests.wsgi.noexist':"):
89
89
 
92
92
 
93
93
    @override_settings(WSGI_APPLICATION="regressiontests.wsgi.wsgi.noexist")
94
94
    def test_bad_name(self):
95
 
        with self.assertRaisesRegexp(
 
95
        with six.assertRaisesRegex(self,
96
96
            ImproperlyConfigured,
97
97
            r"^WSGI application 'regressiontests.wsgi.wsgi.noexist' could not be loaded; can't find 'noexist' in module 'regressiontests.wsgi.wsgi':"):
98
98