mirror of
				https://github.com/django/django.git
				synced 2025-11-03 21:25:09 +00:00 
			
		
		
		
	Lowered memory consumption in debug ouput test
This commit is contained in:
		
							parent
							
								
									5ecead9ab9
								
							
						
					
					
						commit
						00f8b4dfae
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -333,7 +333,7 @@ class ExceptionReporterTests(TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_too_large_values_handling(self):
 | 
					    def test_too_large_values_handling(self):
 | 
				
			||||||
        "Large values should not create a large HTML."
 | 
					        "Large values should not create a large HTML."
 | 
				
			||||||
        large = 32 * 1024 * 1024
 | 
					        large = 256 * 1024
 | 
				
			||||||
        repr_of_str_adds = len(repr(''))
 | 
					        repr_of_str_adds = len(repr(''))
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            class LargeOutput(object):
 | 
					            class LargeOutput(object):
 | 
				
			||||||
| 
						 | 
					@ -345,7 +345,7 @@ class ExceptionReporterTests(TestCase):
 | 
				
			||||||
            exc_type, exc_value, tb = sys.exc_info()
 | 
					            exc_type, exc_value, tb = sys.exc_info()
 | 
				
			||||||
        reporter = ExceptionReporter(None, exc_type, exc_value, tb)
 | 
					        reporter = ExceptionReporter(None, exc_type, exc_value, tb)
 | 
				
			||||||
        html = reporter.get_traceback_html()
 | 
					        html = reporter.get_traceback_html()
 | 
				
			||||||
        self.assertEqual(len(html) // 1024 // 1024, 0)  # still fit in 1MB
 | 
					        self.assertEqual(len(html) // 1024 // 128, 0)  # still fit in 128Kb
 | 
				
			||||||
        self.assertIn('<trimmed %d bytes string>' % (large + repr_of_str_adds,), html)
 | 
					        self.assertIn('<trimmed %d bytes string>' % (large + repr_of_str_adds,), html)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @skipIf(six.PY2, 'Bug manifests on PY3 only')
 | 
					    @skipIf(six.PY2, 'Bug manifests on PY3 only')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue