mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #15229 -- Improved URLValidator to accept ftp:// links. Thanks, codefisher and crayz_train
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -61,6 +61,18 @@ class BaseModelValidationTests(ValidationTestCase): | ||||
|         mtv = ModelToValidate(number=10, name='Some Name', url='http://www.djangoproject.com/') | ||||
|         self.assertEqual(None, mtv.full_clean()) # This will fail if there's no Internet connection | ||||
|  | ||||
|     def test_correct_https_url_but_nonexisting(self): | ||||
|         mtv = ModelToValidate(number=10, name='Some Name', url='https://www.djangoproject.com/') | ||||
|         self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'url', [u'This URL appears to be a broken link.']) | ||||
|  | ||||
|     def test_correct_ftp_url_but_nonexisting(self): | ||||
|         mtv = ModelToValidate(number=10, name='Some Name', url='ftp://ftp.google.com/we-love-microsoft.html') | ||||
|         self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'url', [u'This URL appears to be a broken link.']) | ||||
|  | ||||
|     def test_correct_ftps_url_but_nonexisting(self): | ||||
|         mtv = ModelToValidate(number=10, name='Some Name', url='ftps://ftp.google.com/we-love-microsoft.html') | ||||
|         self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'url', [u'This URL appears to be a broken link.']) | ||||
|  | ||||
|     def test_text_greater_that_charfields_max_length_raises_erros(self): | ||||
|         mtv = ModelToValidate(number=10, name='Some Name'*100) | ||||
|         self.assertFailsValidation(mtv.full_clean, ['name',]) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user