mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[1.7.x] Added test for the #23070 problem
Backport of e569144910 from master.
			
			
This commit is contained in:
		
				
					committed by
					
						 James Bennett
						James Bennett
					
				
			
			
				
	
			
			
			
						parent
						
							bc3d401b9f
						
					
				
				
					commit
					0d8d4fe9b4
				
			| @@ -652,6 +652,21 @@ class ExceptionReporterFilterTests(TestCase, ExceptionReportTestMixin): | |||||||
|             response = self.client.get('/raises500/') |             response = self.client.get('/raises500/') | ||||||
|             self.assertNotContains(response, "This should not be displayed", status_code=500) |             self.assertNotContains(response, "This should not be displayed", status_code=500) | ||||||
|  |  | ||||||
|  |     def test_callable_settings_forbidding_to_set_attributes(self): | ||||||
|  |         """ | ||||||
|  |         Callable settings which forbid to set attributes should not break | ||||||
|  |         the debug page (#23070). | ||||||
|  |         """ | ||||||
|  |         class CallableSettingWithSlots(object): | ||||||
|  |             __slots__ = [] | ||||||
|  |  | ||||||
|  |             def __call__(self): | ||||||
|  |                 return "This should not be displayed" | ||||||
|  |  | ||||||
|  |         with self.settings(DEBUG=True, WITH_SLOTS=CallableSettingWithSlots()): | ||||||
|  |             response = self.client.get('/raises500/') | ||||||
|  |             self.assertNotContains(response, "This should not be displayed", status_code=500) | ||||||
|  |  | ||||||
|     def test_dict_setting_with_non_str_key(self): |     def test_dict_setting_with_non_str_key(self): | ||||||
|         """ |         """ | ||||||
|         A dict setting containing a non-string key should not break the |         A dict setting containing a non-string key should not break the | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user