======================
Integration doctest for qi.jwMedia
======================

Let's add a video

	>>> from StringIO import StringIO
	>>> from qi.jwMedia.tests.utils import getFile
	>>> self.setRoles('Editor')
  
	>>> browser = self.getBrowser()
	>>> browser.open(self.folder.absolute_url())
	>>> browser.getLink(url='createObject?type_name=Flash+Video').click()
	>>> browser.url
	'http://nohost/plone/.../portal_factory/Flash Video/flash.../edit'
	  
	>>> browser.getControl(name='title').value = 'Foo'
	>>> control = browser.getControl(name='flv_file')
	>>> control.filename = 'video.flv'
	>>> control.value = getFile('video.flv')
	>>> browser.getControl('Save').click()
	
And let's try seeing it!
	>>> browser.url
	'http://nohost/plone/.../foo'
	>>> soup = self.BeautifulSoup(browser.contents)
	>>> v = soup.find(id='jwFlash-video')
	>>> v is not None
	True
	>>> v['type']
	u'video'
	>>> v['file']
 	u'http://nohost/.../foo/getFlv'
	>>> v['vwidth']
	u'320'
	>>> v['vheight']
	u'240'
	>>> v['allowfullscreen']
	u'True'
	>>> v['stretching']
	u'uniform'

Is the video file working correctly with/without blobs?

	>>> v = self.folder['foo']
	>>> str(getFile('video.flv').read()) == str(v.getFlv())
	True 
	
	
