<commit_before>============
Link objects
============

For UI-Tests we need a Testbrowser:

>>> from zope.testbrowser.testing import Browser
>>> browser = Browser()
>>> browser.addHeader('Authorization', 'Basic user:userpw')


Creating and editing links
==========================

Create a link object:

>>> browser.open('http://localhost/++skin++cms/repository/online/2007/01')
>>> menu = browser.getControl(name='add_menu')
>>> menu.displayValue = ['Link']
>>> browser.open(menu.value[0])

Now we're looking at the add form. Fill in some data:

>>> browser.getControl('File name').value = 'gocept.link'
>>> browser.getControl('Title').value = 'gocept homepage'
>>> browser.getControl('Ressort').displayValue = ['Leben']
>>> browser.getControl('Teaser title').value = 'gocept teaser'
>>> browser.getControl('Link address').value = 'http://gocept.com'
>>> browser.getControl('Target').displayOptions
['(nothing selected)', 'New window']
>>> browser.getControl(name='form.actions.add').click()

After adding the link is checked out.

>>> 'There were errors' in browser.contents
False

Adding related objects is done on the asset page:

>>> browser.getLink('Edit assets').click()
>>> browser.getControl(name="form.image").value = (
...     'http://xml.zeit.de/2006/DSC00109_2.JPG')
>>> browser.getControl('Add Related').click()
>>> browser.getControl(name="form.related.0.").value = (
...     'http://xml.zeit.de/online/2007/01/Somalia')
>>> browser.getControl('Apply').click()
>>> 'There were errors' in browser.contents
False
<commit_msg>Recent zeit.push adds a form field "Twitter Ressort", so we need to disambiguate<commit_after>============
Link objects
============

For UI-Tests we need a Testbrowser:

>>> from zope.testbrowser.testing import Browser
>>> browser = Browser()
>>> browser.addHeader('Authorization', 'Basic user:userpw')


Creating and editing links
==========================

Create a link object:

>>> browser.open('http://localhost/++skin++cms/repository/online/2007/01')
>>> menu = browser.getControl(name='add_menu')
>>> menu.displayValue = ['Link']
>>> browser.open(menu.value[0])

Now we're looking at the add form. Fill in some data:

>>> browser.getControl('File name').value = 'gocept.link'
>>> browser.getControl('Title').value = 'gocept homepage'
>>> browser.getControl('Ressort', index=0).displayValue = ['Leben']
>>> browser.getControl('Teaser title').value = 'gocept teaser'
>>> browser.getControl('Link address').value = 'http://gocept.com'
>>> browser.getControl('Target').displayOptions
['(nothing selected)', 'New window']
>>> browser.getControl(name='form.actions.add').click()

After adding the link is checked out.

>>> 'There were errors' in browser.contents
False

Adding related objects is done on the asset page:

>>> browser.getLink('Edit assets').click()
>>> browser.getControl(name="form.image").value = (
...     'http://xml.zeit.de/2006/DSC00109_2.JPG')
>>> browser.getControl('Add Related').click()
>>> browser.getControl(name="form.related.0.").value = (
...     'http://xml.zeit.de/online/2007/01/Somalia')
>>> browser.getControl('Apply').click()
>>> 'There were errors' in browser.contents
False

{'fraction_non_alphanumeric': 0.21306277742549143, 'fraction_numerical': 0.015535827520608751, 'mean_word_length': 5.5592515592515594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 129, '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': '7137392', 'n_tokens_mistral': 976, 'n_tokens_neox': 927, 'n_words': 215}