<commit_before>Video blocks
============

>>> import z3c.etestbrowser.testing
>>> import zeit.content.cp.browser.tests
>>> browser = z3c.etestbrowser.testing.ExtendedTestBrowser()
>>> browser.addHeader('Authorization', 'Basic user:userpw')
>>> browser.xml_strict = True
>>> zeit.content.cp.browser.tests.create_cp(browser)
>>> browser.open('contents')
>>> contents_url = browser.url
>>> browser.getLink('Add block', index=0).click()
>>> browser.open(contents_url)
>>> browser.getLink('choose the block type').click()
>>> browser.getLink('Videoblock').click()

Editing the block
-----------------

>>> browser.open(contents_url)
>>> browser.getLink('Edit').click()
>>> browser.getControl('The id of the audio/video.').value = '12345'
>>> browser.getControl('The format of the video.').displayValue = ['small']
>>> browser.getControl('The date until the video is valid.').value = '2009-05-05'
>>> browser.handleErrors = False
>>> browser.getControl('Apply').click()
>>> print browser.contents
<...self.close();...

>>> browser.open(contents_url)
>>> browser.getLink('Edit').click()
>>> browser.getControl('The id of the audio/video.').value
'12345'
>>> browser.getControl('The format of the video.').displayValue
['small']
>>> browser.getControl('The date until the video is valid.').value
'2009-05-05 00:00:00'<commit_msg>Re #5051: added test for the XML representation of a VideoBlock<commit_after>Video blocks
============

>>> import z3c.etestbrowser.testing
>>> import zeit.content.cp.browser.tests
>>> browser = z3c.etestbrowser.testing.ExtendedTestBrowser()
>>> browser.addHeader('Authorization', 'Basic user:userpw')
>>> browser.xml_strict = True
>>> zeit.content.cp.browser.tests.create_cp(browser)
>>> browser.open('contents')
>>> contents_url = browser.url
>>> browser.getLink('Add block', index=0).click()
>>> browser.open(contents_url)
>>> browser.getLink('choose the block type').click()
>>> browser.getLink('Videoblock').click()

Editing the block
-----------------

>>> browser.open(contents_url)
>>> browser.getLink('Edit').click()
>>> browser.getControl('The id of the audio/video.').value = '12345'
>>> browser.getControl('The format of the video.').displayValue = ['small']
>>> browser.getControl('The date until the video is valid.').value = '2009-05-05'
>>> browser.handleErrors = False
>>> browser.getControl('Apply').click()
>>> print browser.contents
<...self.close();...

>>> browser.open(contents_url)
>>> browser.getLink('Edit').click()
>>> browser.getControl('The id of the audio/video.').value
'12345'
>>> browser.getControl('The format of the video.').displayValue
['small']
>>> browser.getControl('The date until the video is valid.').value
'2009-05-05 00:00:00'

XML format
----------

>>> browser.open(contents_url)
>>> browser.open('@@xml_source_edit.html')
>>> print browser.getControl(name='form.xml').value
<...<container cp:type="videoblock" module="video" cp:__name__="<GUID>"
videoID="12345" expires="2009-05-04T22:00:00+00:00" format="small"/>...

{'fraction_non_alphanumeric': 0.21760964178105122, 'fraction_numerical': 0.03247405423501841, 'mean_word_length': 5.552631578947368, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 164, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2546028', 'n_tokens_mistral': 970, 'n_tokens_neox': 907, 'n_words': 182}