Exemple #1
0
class TestVideoField(ERP5TypeTestCase):
    """Tests Video field
  """
    def getTitle(self):
        return "Video Field"

    def afterSetUp(self):
        self.field = VideoField('test_field')
        self.widget = self.field.widget

    def test_render_view(self):
        self.field.values['default'] = 'Video content'

        self.assertEqual('<video preload="auto" src="Video content" controls="controls" height="85" width="160" >Your browser does not support video tag.</video>', \
                          self.field.render_view(value='Video content'))

        self.field.values['video_preload'] = False
        self.field.values['video_loop'] = True
        self.field.values['video_controls'] = False
        self.field.values['video_autoplay'] = True
        self.field.values['video_error_message'] = 'Another error message'
        self.field.values['video_height'] = 800
        self.field.values['video_width'] = 1280

        self.assertEqual('<video src="Another Video content" ' +
            'height="800" width="1280" loop="loop" autoplay="autoplay" ' +
            '>Another error message</video>', \
                self.field.render_view(value='Another Video content'))
Exemple #2
0
class TestVideoField(ERP5TypeTestCase):
  """Tests Video field
  """

  def getTitle(self):
    return "Video Field"

  def afterSetUp(self):
    self.field = VideoField('test_field')
    self.widget = self.field.widget

  def test_render_view(self):
    self.field.values['default'] = 'Video content'

    self.assertEqual('<video preload="preload" src="Video content" controls="controls" height="85" width="160" >\nYour browser does not support video tag.</video>', \
                      self.field.render_view(value='Video content'))

    self.field.values['video_preload'] = False
    self.field.values['video_loop'] = True
    self.field.values['video_controls'] = False
    self.field.values['video_autoplay'] = True
    self.field.values['video_error_message'] = 'Another error message'
    self.field.values['video_height'] = 800
    self.field.values['video_width'] = 1280

    self.assertEqual('<video src="Another Video content" ' +
        'height="800" width="1280" loop="loop" autoplay="autoplay" ' +
        '>\nAnother error message</video>', \
            self.field.render_view(value='Another Video content'))
Exemple #3
0
 def afterSetUp(self):
     self.field = VideoField('test_field')
     self.widget = self.field.widget
Exemple #4
0
 def afterSetUp(self):
   self.field = VideoField('test_field')
   self.widget = self.field.widget