Commit 318c1c32 authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
Browse files

[1.0.X] The tests added in r9185 were altering the test environment in bad

ways. Fixed this with proper setUp() and tearDown() methods.

Backport of r9200 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9203 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent b3c2cf3d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -6,6 +6,14 @@ from django.middleware.common import CommonMiddleware
from django.conf import settings

class CommonMiddlewareTest(TestCase):
    def setUp(self):
        self.slash = settings.APPEND_SLASH
        self.www = settings.PREPEND_WWW

    def tearDown(self):
        settings.APPEND_SLASH = self.slash
        settings.PREPEND_WWW = self.www

    def _get_request(self, path):
        request = HttpRequest()
        request.META = {