Commit Graph

342 Commits

Author SHA1 Message Date
Antony Lesuisse 3aa98edaaf [IMP] test add an url_open helper to http case
bzr revid: al@openerp.com-20140306234535-9zhumihumbzcddb2
2014-03-07 00:45:35 +01:00
Xavier Morel 013d27b850 [IMP] filter out phantomjs warning on OSX
bzr revid: xmo@openerp.com-20140221143448-tpx62ua785kc8gfx
2014-02-21 15:34:48 +01:00
Xavier Morel fc780d5a81 [FIX] actually retry select on EINTR
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
2014-02-19 16:53:03 +01:00
Xavier Morel d5cb5c2a14 [FIX] correctly display JS stack frames in phantomjs runner
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
2014-02-19 13:38:50 +01:00
Xavier Morel fbead8fab1 [IMP] style
use break instead of return so cleanup can eventually be put after loop if necessary (?)

bzr revid: xmo@openerp.com-20140219101334-n8fcmzxptrqj717a
2014-02-19 11:13:34 +01:00
Xavier Morel abb58ee3b8 [FIX] possibility of select being interrupted, just restart the call
uses EnvironmentError because not sure if socket.error or os.error

bzr revid: xmo@openerp.com-20140219101110-4g4o658vzsol7jae
2014-02-19 11:11:10 +01:00
Xavier Morel cb03b384b0 [IMP] phantomjs runner
* 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
2014-02-18 14:34:45 +01:00
Xavier Morel 71259f09f4 [ADD] hooks to enable/disable tests running during install
also add flag for post_install run, but not used yet

bzr revid: xmo@openerp.com-20140218095452-pptez5rlpdez1ttl
2014-02-18 10:54:52 +01:00
Antony Lesuisse 75c350976c [FIX] tests HttpCase phantomjs conditional injection inject=[(need,file)]
bzr revid: al@openerp.com-20140217000150-wt3pwqrqcd7n2mfd
2014-02-17 01:01:50 +01:00
Antony Lesuisse c8324bafcc [IMP] phantomjs testing
- avoid dbmanager by presetting db in the test session
- correctly handle login option
- serialize test cursor access

bzr revid: al@openerp.com-20140216212222-4o6x9uljyua3g1og
2014-02-16 22:22:22 +01:00
Antony Lesuisse 42db02f73c [FIX] tests HTTPCase if phantomjs is not installed
bzr revid: al@openerp.com-20140216162026-ymbzoi70txbr64yl
2014-02-16 17:20:26 +01:00
Christophe Matthieu 90ed82bb14 [IMP] test phantomtest: inject files with testing if a variable is already setted
bzr revid: chm@openerp.com-20140210131910-z8eggofegua88516
2014-02-10 14:19:10 +01:00
Antony Lesuisse 1f78dfb76d [IMP] phantomjs testing add an easy phantom_js helper
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
2014-02-10 01:45:17 +01:00
Antony Lesuisse 1f67b2165c [IMP] phantomtest helper
bzr revid: al@openerp.com-20140209223917-vruzjvl0mtsqoo87
2014-02-09 23:39:17 +01:00
Antony Lesuisse e6ac29ee43 [IMP] move test cases to tests.py remove deprecated wsgi import
bzr revid: al@openerp.com-20140209151822-cgk0wibqe1kfd42w
2014-02-09 16:18:22 +01:00
Antony Lesuisse 278ed718e9 new test execution engine
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
2014-02-09 01:40:05 +01:00
Antony Lesuisse 82372e6a02 move tests
move test modules
remove xml test
add phantomjs test
readd remove uninstall test (currently disabled because of cr.commit)

bzr revid: al@openerp.com-20140209003745-ehrx8ikwkmusa644
2014-02-09 01:37:45 +01:00
Fabien Pinckaers 849125efd2 [FIX] removing test that commits and small fix
bzr revid: fp@tinyerp.com-20140131002701-4eaggu8tszph4vl5
2014-01-31 01:27:01 +01:00
Olivier Dony 95d3995614 [MERGE] Sync with trunk revno 5038 rev-id ged@openerp.com-20140127161125-2br49sy5bnyuen7f
bzr revid: odo@openerp.com-20140128184158-19hj4mg83jazp3nr
2014-01-28 19:41:58 +01:00
Christophe Simonis a47f7ef8e8 [FIX] do not hardcode demo uid
bzr revid: chs@openerp.com-20140128180910-2udedma5dwwtos4c
2014-01-28 19:09:10 +01:00
Xavier Morel 98bb821332 [FIX] fubared ir_filters tests
bzr revid: xmo@openerp.com-20140128164849-iv19wiwx2074l18f
2014-01-28 17:48:49 +01:00
jke-openerp c9fa796513 [FIX] Remove hard code demo user ID
bzr revid: jke@openerp.com-20140128155640-9k5kvk711tt9w9o5
2014-01-28 16:56:40 +01:00
Gery Debongnie a42900b8ea [FIX] fixes the read_group by dates tests (makes them use the field:interval syntax instead of using the context (test_orm.py)
bzr revid: ged@openerp.com-20140123130603-5kdlb7as7fhmchd8
2014-01-23 14:06:03 +01:00
Gery Debongnie 99230cd3d1 [FIX] prints some value so i can understand how to debug the failing test in test_orm.py
bzr revid: ged@openerp.com-20140123112347-0swvj6xrhp5r5mpq
2014-01-23 12:23:47 +01:00
Gery Debongnie 74fd48e608 [FIX] fixes the read_group by dates tests (makes them use the field:interval syntax instead of using the context (test_orm.py)
bzr revid: ged@openerp.com-20140123105638-l4ej76ynf4avcjma
2014-01-23 11:56:38 +01:00
Thibault Delavallée ab5c23079a [MERGE] Sync with trunk, solved conflicts.
bzr revid: tde@openerp.com-20140116091716-zk1n5ots94i65io5
2014-01-16 10:17:16 +01:00
Christophe Simonis 0771ca2692 [MERGE] forward port of branch saas-2 up to revid 5002 dle@openerp.com-20140114173613-ruxye1m7fxtcjfim
bzr revid: chs@openerp.com-20140115205357-arptzm69logz3osm
2014-01-15 21:53:57 +01:00
Christophe Simonis a69f789b41 [MERGE] forward port of branch 7.0 up to revid 5224 chs@openerp.com-20140206105141-7e8bv8ordqqsswh7
bzr revid: dle@openerp.com-20140205105045-j95kduyjiq83e57z
bzr revid: dle@openerp.com-20140114173613-ruxye1m7fxtcjfim
bzr revid: dle@openerp.com-20140116161158-u95vcs3os4tk2zob
bzr revid: dle@openerp.com-20140121172737-gzawfi3ssg7xifef
bzr revid: chs@openerp.com-20140129094554-c3abc8x3qz9mpszr
bzr revid: chs@openerp.com-20140129140159-9vwkpr078shoonum
bzr revid: chs@openerp.com-20140206110220-myn57cryam1y4k9v
2014-02-06 12:02:20 +01:00
Thibault Delavallée c63ffed24d [IMP] tools: mail: the cleaner, by parsing and serializing the html content,
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
2014-01-15 15:27:09 +01:00
Olivier Dony 7a819ca8d0 [FIX] tools.email_split: improve email extraction using stdlib + extra tests
The original code was having issues telling apart
names containing emails from the actual email.
This patch is inspired by Etienne Hirt's patch
on bug 1165531 for OpenERP 6.1.
This will also help solve bug 1199386, if we can
centralize all email parsing through this helper.

lp bug: https://launchpad.net/bugs/1199386 fixed
lp bug: https://launchpad.net/bugs/1165531 fixed

bzr revid: odo@openerp.com-20140114154426-usu6intv5139egd3
2014-01-14 16:44:26 +01:00
Xavier Morel 43bc13de27 [REM] datetime pattern conversion tests
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
2014-01-09 09:17:31 +01:00
Xavier Morel 23b8f160d3 [IMP] attempt (again) to fix testing of datetime pattern conversions tests
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
2014-01-08 17:28:17 +01:00
Xavier Morel f6a5800d59 [ADD] ability to disable fields escaping
bzr revid: xmo@openerp.com-20131216092330-2v50c8uzzsb3qp8q
2013-12-16 10:23:30 +01:00
Xavier Morel 3b56c80ced [FIX] attempt to fix issues of Locale.parse(None) returning None
use Locale.default() instead of manually parsing the result of locale.getdefaultlocale()

bzr revid: xmo@openerp.com-20131213104030-0tejn7i13yex975v
2013-12-13 11:40:30 +01:00
Christophe Matthieu 8460122209 [MERGE] sync with trunk
bzr revid: chm@openerp.com-20131202150856-fzrfcoa8pmsjutau
2013-12-02 16:08:56 +01:00
Christophe Simonis 56bb1b9869 [MERGE] forward port of branch saas-2 up to revid 4992 chs@openerp.com-20131202105848-33gcz1715w370rve
bzr revid: chs@openerp.com-20131127110757-5kaay2kcxq0ysb59
bzr revid: chs@openerp.com-20131127161639-yur4rdh3wx43kxle
bzr revid: chs@openerp.com-20131127180647-f8uws77gaym5kfvd
bzr revid: chs@openerp.com-20131202110030-gf20dv2uj5fqv7c2
2013-12-02 12:00:30 +01:00
Xavier Morel 103cea2da0 [FIX] change ManyToOne converter to use read on parent record and pass the browse_record's context through
avoids access rights issue, can be used for automagical formatting of address on res.partner

bzr revid: xmo@openerp.com-20131202095638-hoj7sxvax5808irc
2013-12-02 10:56:38 +01:00
Xavier Morel 228938ccba [ADD] formats support to date and datetime converters
bzr revid: xmo@openerp.com-20131202073313-tu79esduu5bvyaai
2013-12-02 08:33:13 +01:00
Xavier Morel 71b25c5add [ADD] relative datetime qweb widget
bzr revid: xmo@openerp.com-20131129085256-dwpcy0rd5v6bls9d
2013-11-29 09:52:56 +01:00
Xavier Morel ea56dece85 [ADD] duration widget
bzr revid: xmo@openerp.com-20131128153630-pouwmygw6vgyuj1l
2013-11-28 16:36:30 +01:00
Christophe Simonis 8a1a3e996f [FIX] add missing access rules for `test_workflow` test module
bzr revid: chs@openerp.com-20131127212618-rbd0v6nnxx2u68jp
2013-11-27 22:26:18 +01:00
Xavier Morel 765429cfb0 [FIX] missing import lost during merge
bzr revid: xmo@openerp.com-20131127112908-ldwf1r1ypwx9pepx
2013-11-27 12:29:08 +01:00
Christophe Simonis 63601c6650 [FIX] html_sanitize does not raise exception for empty string anymore. correct related test
bzr revid: chs@openerp.com-20131125174956-1y13zszzf9h2pkl6
2013-11-25 18:49:56 +01:00
Christophe Simonis ab386c0f5f [MERGE] forward port of branch saas-2 up to revid 4984 chs@openerp.com-20131125151017-lmj53bxg1pfrr4a7
bzr revid: chs@openerp.com-20131125154140-cpbk4tcdml2a3b9n
2013-11-25 16:41:40 +01:00
Denis Ledoux 6fd552c3ce [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5139 rev-id: dle@openerp.com-20131121132305-qjlclgz5v9tze1fr
bzr revid: odo@openerp.com-20131120102545-2tlp031yib6viz35
bzr revid: chs@openerp.com-20131120161708-c8sbom592moukwxw
bzr revid: dle@openerp.com-20131121155457-lh7fzouk2upeiu16
2013-11-21 16:54:57 +01:00
Xavier Morel 8e78b40e6a [MERGE] from trunk
bzr revid: xmo@openerp.com-20131115132553-9eqxggih8be63i36
2013-11-15 14:25:53 +01:00
Christophe Simonis 7ba1d747cc [FIX] html_sanitize: handle the case of empty documents (after sanitization).
[IMP] test_mail: do not mute logger

bzr revid: chs@openerp.com-20131113113715-tzaog0d6o2u4q0x4
2013-11-13 12:37:15 +01:00
Stephane Wirtel c9a7e69a75 [FIX] test_mail: Rewrite the XSS test
bzr revid: stw@openerp.com-20131107141019-jjhvism55j8x207g
2013-11-07 15:10:19 +01:00
Christophe Simonis a044bdbf8a [FIX] mute logger in some tests
bzr revid: chs@openerp.com-20131029141939-xt9093hfv8cfjkdo
2013-10-29 15:19:39 +01:00
Thibault Delavallée 97f164ba99 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20131028163325-2hpks3hp23zop40n
2013-10-28 17:33:25 +01:00