mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 01:47:59 +03:00 
			
		
		
		
	Django 1.7 has new 404 and 403 body messages.
This commit is contained in:
		
							parent
							
								
									23a20160c4
								
							
						
					
					
						commit
						656117814c
					
				| 
						 | 
					@ -108,11 +108,13 @@ class TemplateHTMLRendererExceptionTests(TestCase):
 | 
				
			||||||
    def test_not_found_html_view_with_template(self):
 | 
					    def test_not_found_html_view_with_template(self):
 | 
				
			||||||
        response = self.client.get('/not_found')
 | 
					        response = self.client.get('/not_found')
 | 
				
			||||||
        self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
 | 
					        self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
 | 
				
			||||||
        self.assertEqual(response.content, six.b("404: Not found"))
 | 
					        self.assertTrue(response.content in (
 | 
				
			||||||
 | 
					            six.b("404: Not found"), six.b("404 Not Found")))
 | 
				
			||||||
        self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
 | 
					        self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_permission_denied_html_view_with_template(self):
 | 
					    def test_permission_denied_html_view_with_template(self):
 | 
				
			||||||
        response = self.client.get('/permission_denied')
 | 
					        response = self.client.get('/permission_denied')
 | 
				
			||||||
        self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
 | 
					        self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
 | 
				
			||||||
        self.assertEqual(response.content, six.b("403: Permission denied"))
 | 
					        self.assertTrue(response.content in (
 | 
				
			||||||
 | 
					            six.b("403: Permission denied"), six.b("403 Forbidden")))
 | 
				
			||||||
        self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
 | 
					        self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user