mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Completed test coverage for forms.RegexField.
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							fb9b1c245d
						
					
				
				
					commit
					9a015f4e0d
				
			| @@ -65,3 +65,12 @@ class RegexFieldTest(SimpleTestCase): | ||||
|         self.assertEqual('1234', f.clean('1234')) | ||||
|         with self.assertRaisesMessage(ValidationError, "'Enter a valid value.'"): | ||||
|             f.clean('abcd') | ||||
|  | ||||
|     def test_get_regex(self): | ||||
|         f = RegexField('^[a-z]+$') | ||||
|         self.assertEqual(f.regex, re.compile('^[a-z]+$')) | ||||
|  | ||||
|     def test_regexfield_strip(self): | ||||
|         f = RegexField('^[a-z]+$', strip=True) | ||||
|         self.assertEqual(f.clean(' a'), 'a') | ||||
|         self.assertEqual(f.clean('a '), 'a') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user