mirror of
https://github.com/Hopiu/django-embed-video.git
synced 2026-03-16 21:30:23 +00:00
Add tests for embed_video.fields
This commit is contained in:
parent
b549271d1a
commit
25f88793e2
1 changed files with 7 additions and 0 deletions
|
|
@ -45,3 +45,10 @@ class EmbedVideoFormFieldTestCase(TestCase):
|
|||
with patch('embed_video.fields.detect_backend') as mock_detect_backend:
|
||||
mock_detect_backend.return_value = True
|
||||
self.assertEqual(url, self.formfield.validate(url))
|
||||
|
||||
def test_validation_super(self):
|
||||
self.assertRaises(ValidationError, self.formfield.validate, '')
|
||||
|
||||
def test_validation_allowed_empty(self):
|
||||
formfield = EmbedVideoFormField(required=False)
|
||||
self.assertIsNone(formfield.validate(''))
|
||||
|
|
|
|||
Loading…
Reference in a new issue