mirror of
				https://github.com/django/django.git
				synced 2025-10-31 20:09:34 +00:00 
			
		
		
		
	 4c30fa905d
			
		
	
	
		4c30fa905d
		
	
	
	
	
		
			
			This is preparation for landing the template-based widget rendering patch and goes a long way to making these tests more useful for future development. The old doctest heritage is strong here.
		
			
				
	
	
		
			9 lines
		
	
	
	
		
			342 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			9 lines
		
	
	
	
		
			342 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from django.test import SimpleTestCase
 | |
| 
 | |
| 
 | |
| class WidgetTest(SimpleTestCase):
 | |
|     beatles = (('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo'))
 | |
| 
 | |
|     def check_html(self, widget, name, value, html='', attrs=None, **kwargs):
 | |
|         output = widget.render(name, value, attrs=attrs, **kwargs)
 | |
|         self.assertHTMLEqual(output, html)
 |