Test for https://dev.plone.org/ticket/7627
===========================================

Goal is to have values from selection widgets translated in /base_view::

    >>> from plone.app.testing import SITE_OWNER_NAME
    >>> from plone.app.testing import login
    >>> from plone.testing.z2 import Browser
    >>> from Products.Archetypes.tests.utils import makeContent
    >>> from zope.component import getGlobalSiteManager
    >>> from zope.component import provideUtility
    >>> from zope.i18n import ITranslationDomain
    >>> from zope.interface import implements
    >>> import transaction
    >>> app = layer['app']
    >>> portal = layer['portal']
    >>> login(app, SITE_OWNER_NAME)
    >>> def browser(url):
    ...     transaction.commit()
    ...     br = Browser(app)
    ...     br.handleErrors = False
    ...     br.addHeader('Authorization','Basic %s:%s'%(SITE_OWNER_NAME, 'secret'))
    ...     br.open(url)
    ...     return br
    >>> doc = makeContent(portal, portal_type='ComplexType', id='vocdemodoc3')


First make a custom translator for our i18n domain::

    >>> class TranslationDomain(object):
    ...     implements(ITranslationDomain)
    ...     def translate(self, msgid, mapping=None,
    ...                   context=None, target_language=None,
    ...                   default=None):
    ...         return "translated:%s" % (msgid)
    >>> t = TranslationDomain()
    >>> gsm = getGlobalSiteManager()
    >>> gsm.registerUtility(t, ITranslationDomain, 'attesti18n')

Now be sure our values are correctly translated in view::

    >>> doc.setSelectionlinesfield2('Test')
    >>> doc.setSelectionlinesfield3(['test2'])
    >>> transaction.commit()
    >>> br = browser(doc.absolute_url()+"/base_view")
    >>> 'translated:test2' in br.contents and 'translated:Test' in br.contents
    True
    >>> gsm.unregisterUtility(t, ITranslationDomain, 'attesti18n')
    True