Skip to content

Commit

Permalink
Add tests for embed_video.fields
Browse files Browse the repository at this point in the history
  • Loading branch information
yetty committed Mar 24, 2014
1 parent b549271 commit 25f8879
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions embed_video/tests/tests_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ def test_validation_correct(self):
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(''))

0 comments on commit 25f8879

Please sign in to comment.