mirror of
				https://github.com/django/django.git
				synced 2025-11-04 13:39:16 +00:00 
			
		
		
		
	Added test for too large input to django.utils.http.base36_to_int().
This commit is contained in:
		
							parent
							
								
									4fe6588da3
								
							
						
					
					
						commit
						41a7876991
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -61,6 +61,9 @@ class TestUtilsHttp(unittest.TestCase):
 | 
				
			||||||
        for n in ['#', ' ']:
 | 
					        for n in ['#', ' ']:
 | 
				
			||||||
            with self.assertRaises(ValueError):
 | 
					            with self.assertRaises(ValueError):
 | 
				
			||||||
                http.base36_to_int(n)
 | 
					                http.base36_to_int(n)
 | 
				
			||||||
 | 
					        with self.assertRaises(ValueError) as cm:
 | 
				
			||||||
 | 
					            http.base36_to_int('1' * 14)
 | 
				
			||||||
 | 
					        self.assertEqual('Base36 input too large', str(cm.exception))
 | 
				
			||||||
        for n in [123, {1: 2}, (1, 2, 3), 3.141]:
 | 
					        for n in [123, {1: 2}, (1, 2, 3), 3.141]:
 | 
				
			||||||
            with self.assertRaises(TypeError):
 | 
					            with self.assertRaises(TypeError):
 | 
				
			||||||
                http.base36_to_int(n)
 | 
					                http.base36_to_int(n)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue