[Product-Developers] Help about writing a test

Silvio silviot at gmail.com
Wed Feb 4 14:09:26 UTC 2009


Hi all,

I'm writing a doctest where I have to check that some translations are in
place.
I wrote this in a PloneTestCase doctest:

>>> self.portal.portal_languages.addSupportedLanguage('fr')
>>> self.portal.portal_languages.setDefaultLanguage('fr')
>>> browser.open(self.portal.absolute_url())
>>> "Accueil" in browser.contents
True

but it fails: the language is always English.
I tried
>>> self.portal.portal_languages.supported_langs = ['fr']
and
>>> import transaction
>>> transaction.commit()
but the test still fails.
Doing the same in a debug session (and committing the transactions) yields
the expected results (the site loads in French).
How can I test languages other than english?
Thanks for your help.


             Silvio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20090204/26fc78a6/attachment.html>


More information about the Product-Developers mailing list