Ejemplo n.º 1
0
 def test_valid_youtube_video(self):
     """Test that a valid youtube video passes the validation """
     form_data = {
         'video_type': YOUTUBE_VIDEO_TYPE,
         'URL': 'http://www.youtube.com/watch?v=DJ_uZiueQKg',
         'use_end': 'on',
         'use_start': 'on',
         'start_time': 5,
         'end_time': 15,
     }
     form = VideoEntryForm(data=form_data)
     self.assertTrue(form.is_valid())
Ejemplo n.º 2
0
 def test_invalid_start_end_times(self):
     """Test that a start time occuring after an end time fails validation"""
     form_data = {
         'video_type': YOUTUBE_VIDEO_TYPE,
         'URL': 'http://www.youtube.com/watch?v=DJ_uZiueQKg',
         'use_end': True,
         'use_start': True,
         'start_time': 15,
         'end_time': 5,
     }
     form = VideoEntryForm(data=form_data)
     self.assertFalse(form.is_valid())