This test was depending on the error string returned by postgresql.
As these strings are localized, the test was failing on systems
where posgresql locale was not set to 'en_US'.
In this new version, we now check the error code returned by postgresql
(which is, obviously, platform independent)
bzr revid: rim@openerp.com-20140306110356-72mgz3korkq3rkde
whether the content of the html field should be sanitized before storage. This parameter
is true by default.
Example of use: html of email template is considered as html content, but contains
mako strings that makes this content not valid html. Sanitizing the body content
can cause issues to the template; therefore storing it as html but not sanitized
allows to keep its content safe.
Added a test case to ensure this behavior.
bzr revid: tde@openerp.com-20140227120254-6m8gvkt4hf28nl0e
Turns out select has its own select.error which does *not* subclass
EnvironmentError (or OSError or IOError) and does *not* have a .errno
attribute. So use the correct exception, might just work better than using
a completely different one with no relation.
bzr revid: xmo@openerp.com-20140219155303-sgz7m3gnzr2bmani
altered reporting to handle and deserialize JSON if JSON-deserializable. Can't
just send multiple lines as driver currently does not handle multiple lines of
message... Yeah turns out having a JSON-based protocol between phantomjs and
the python runner allowed multiple lines in messages, who'd have thought eh?
bzr revid: xmo@openerp.com-20140219123850-0h0upb3x33j7leqk
* use Skip exception to skip tests in case phantomjs binary not found
* remove spurious logging, move some to debug when debatable
* use testing assertions for correct reporting
* allow failure message
* use mutable buffer to accumulate stdout data
bzr revid: xmo@openerp.com-20140218133445-e5l155j10i934o88
self.phantom_js(<page_to_load>, <code_to_run>, <global_object_to_wait>, **options)
example:
self.phantom_js("/", "openerp.module.mytest()", "openerp.module.mytest");
console.log('ok') or console.log('error') should be used to signal success or
failure. Other console.log's will be passed to the test logger.
bzr revid: al@openerp.com-20140210004517-jc2cobc31qshxchm
remove deprecated zipfile support
add preload_registry option when server is running
allow registries to be used in contruction in test mode
add a rollback test case for http tests
add a phantomjs helper
bzr revid: al@openerp.com-20140209004005-p5pwym4sqc23vw5b
encapsulatse the whole content inside a div. This means that html fields are
not editor-clean after being sanitized, because a div has been inserted as root
element. Removing this element allows to have snippets that can be dragged,
dropped, or to insert new snippets inside edited html content in html fields.
[IMP] tools: tests: mail: updated a test accordingly
bzr revid: tde@openerp.com-20140115142709-e4951b4nc06sfxf0
locales are a pain in the ass, there doesn't seem to be any locale
which all machines are guaranteed to have (except maybe C), and some
systems reject encoding-less locales while babel rejects encodings.
bzr revid: xmo@openerp.com-20140109081731-uryy2aa2odc7ud2g
In order to ensure that the conversion is at least sensible, we test
the output of strftime and babel on the same pattern (after conversion
from POSIX to LDML for Babel). This requires that both use the same
locale.
Previously, the default locale was being used(-ish), but it turns out
when the locale is unset (getdefaultlocale() returns (None, None)
``strftime`` still manages to use some sort of default locale (C?),
whereas Babel will yield the locale None. It turns out the runbot
executes the server with no locale-related envvar set, and thus hits
this very issue.
Assume there are no concurrent tests being run and use setlocale to
try and ensure strftime and babel see the same locale.
Also, remove tests on %x and %X, turns out libc and babel generally
have very different ideas about what constitutes a "national
representation" of a date or time, so the patterns don't match in the
first place. And I found no way to expand %x/%X into its sub-patterns.
bzr revid: xmo@openerp.com-20140108162817-n5gd2oryaszf099k
Fixed length computation of text in html nodes: multiples successive
whitespaces are considered as one whitespaces; better truncate position
when adding a read more link; now always protect words (placed after
the first word that exceeds the shorten position); pre nodes are preserved
about whitespaces; when the read more link should go into a quote, it instead
goes at the end of the first parent node not being quoted instead of at
a wrong position.
Added tests for shorten position.
bzr revid: tde@openerp.com-20131022135037-igauu2kkglvdrqu7
Read more links could not appear when the shorten limit was obtained
inside a quote that is removed in the process, removing the read
more link node. It now get the first parent that is not inside a
quote to be sure the link is displayed.
Added the test-case that helped find this bug.
bzr revid: tde@openerp.com-20131017110525-etn0u5s91zbnvul1
ir.fields architecture turns out not to be a very good or simple fit,
especially as different widgets/fields need different granularity of
customizations. Having objects dedicated to each field type/widget
makes things simpler as it allows a conversion pipeline which can be
plugged into at any point.
bzr revid: xmo@openerp.com-20131007091556-03azc2mdhcb7kmwo
remove the /openerp/* routes, they were never used because the protocol was too
different from the historical /xmlrpc/ routes. Instead we introduce a
/xmlrpc/2/ route identical to /xmlrpc/ with the only difference that it returns
int faultCodes making it compliant with the XML-RPC specification.
bzr revid: al@openerp.com-20131006102131-707kxc9zyd1mvlps
It can now take into account sections, and protect them. This allows to display a read more link
after a whole section. This will be used in the website, to display the first section of blogs for
example.
Also added some options on the read more link, allowing to tune its tag, content, as well as the link.
Also improved html_sanitize, taking improvements from the trunk branch of server, waiting for the whole
trunk branch to be merged.
bzr revid: tde@openerp.com-20131001142151-rt1g6zpxozd1eau2
> many2one --> mettre <br/> si multi-line, html escape le reste (ex:
> adresse sur un event, on a du mettre dans un <pre> mais ce n'est pas
> bien)
> text --> mettre <br/> si multi-line, html escape le reste (ex:
> description d'un produit, à droite)
> char --> normalement pas de multi-line
> fields.binary --> t-field on image field ne semble pas fonctionner
> en écriture (la photo d'une fiche produit)
(validates that the binary field's content is image data by opening it
with PIL, then generates an <img> tag)
TODO:
> fields.float --> utiliser le digits pour formatter les decimals
> correctement (ex: prix d'un produit, à deux décimales)
> On aura aussi besoin d'un widget="currency", un peu comme dans la
> vue form du client web.
bzr revid: xmo@openerp.com-20130926133850-ab14h241q878jbom