@@ -28,27 +28,36 @@ def test_redirect(self):
2828 redirect ['Location' ] = 'http://somewhere/else/'
2929 response = self .panel .process_response (self .request , redirect )
3030 self .assertFalse (response is redirect )
31- self .assertContains (response , '302 FOUND' )
31+ try :
32+ self .assertContains (response , '302 Found' )
33+ except AssertionError : # Django < 1.9
34+ self .assertContains (response , '302 FOUND' )
3235 self .assertContains (response , 'http://somewhere/else/' )
3336
3437 def test_redirect_with_broken_context_processor (self ):
35- context_processors = settings .TEMPLATE_CONTEXT_PROCESSORS + (
38+ context_processors = list ( settings .TEMPLATE_CONTEXT_PROCESSORS ) + [
3639 'tests.context_processors.broken' ,
37- )
40+ ]
3841
3942 with self .settings (TEMPLATE_CONTEXT_PROCESSORS = context_processors ):
4043 redirect = HttpResponse (status = 302 )
4144 redirect ['Location' ] = 'http://somewhere/else/'
4245 response = self .panel .process_response (self .request , redirect )
4346 self .assertFalse (response is redirect )
44- self .assertContains (response , '302 FOUND' )
47+ try :
48+ self .assertContains (response , '302 Found' )
49+ except AssertionError : # Django < 1.9
50+ self .assertContains (response , '302 FOUND' )
4551 self .assertContains (response , 'http://somewhere/else/' )
4652
4753 def test_unknown_status_code (self ):
4854 redirect = HttpResponse (status = 369 )
4955 redirect ['Location' ] = 'http://somewhere/else/'
5056 response = self .panel .process_response (self .request , redirect )
51- self .assertContains (response , '369 UNKNOWN STATUS CODE' )
57+ try :
58+ self .assertContains (response , '369 Unknown Status Code' )
59+ except AssertionError : # Django < 1.9
60+ self .assertContains (response , '369 UNKNOWN STATUS CODE' )
5261
5362 def test_unknown_status_code_with_reason (self ):
5463 redirect = HttpResponse (status = 369 , reason = 'Look Ma!' )
0 commit comments