Commit Graph

214 Commits

Author SHA1 Message Date
Vo Minh Thu 680214c47e [FIX] tools.translate: when loading entries from a PO file, use also the POT.
On Launchpad, as commented on bug 933496, PO entries (and their comments) are
shared between series. This mean that e.g. the 7.0 series can have the wrong
`reference` comments (those beginning with #:) as they would be copied from say
the trunk series. Those `reference` comments are used to import translations
and look them up.

This patch adds a few lines of code to tools.translate so that targets
defined in the POT `reference` comments are used in addition to those from the
PO file.

Also adds a test module to validate the new behavior.

This patch stems from:
 - the 6.1 branch by Vo Minh Thu:
    https://code.launchpad.net/+branch/~openerp-dev/openobject-server/6.1-fix-po-targets-933496-vmt
 - the 7.0 port by Numerigraphe:
    https://code.launchpad.net/~numerigraphe-team/openobject-server/7.0-fix-po-targets-933496-vmt
2014-08-13 23:07:40 +02:00
Richard Mathot (OpenERP) 6f99891b82 [REF] Use assertEqual method instead of assert instruction
bzr revid: rim@openerp.com-20140306112053-e0znv1g2378ghs46
2014-03-06 12:20:53 +01:00
Richard Mathot (OpenERP) 3c65ffc29f [FIX] Test for ir_sequence:
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
2014-03-06 12:03:56 +01:00
Martin Trigaux 43df0b4d23 [MERGE] [FIX] orm: when generating xml ids for export, use the model of the exported field instead of the current model. Courtesy of Stefan Rijnhart (Therp).
bzr revid: mat@openerp.com-20140226133716-vgdjjmqc2lou0n3u
2014-02-26 14:37:16 +01:00
Martin Trigaux 7b41032e2a [IMP] move test on property fields to his own test class
bzr revid: mat@openerp.com-20140213133254-ahzac9o009su3d2x
2014-02-13 14:32:54 +01:00
Martin Trigaux e201ea3190 [ADD] tests checking the properties fields are not overwritten by changes in parent companies
bzr revid: mat@openerp.com-20140213131009-25knm17hie7uzeko
2014-02-13 14:10: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
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
Christophe Simonis a044bdbf8a [FIX] mute logger in some tests
bzr revid: chs@openerp.com-20131029141939-xt9093hfv8cfjkdo
2013-10-29 15:19:39 +01:00
Stefan Rijnhart 62ea0bb383 [FIX] Update test for external id
bzr revid: stefan@therp.nl-20131024214735-emciqtcm6vrs9xda
2013-10-24 23:47:35 +02:00
Christophe Simonis e78a83ac03 [FIX] browse records do not prefetch fields with groups
bzr revid: chs@openerp.com-20130819174930-xjzmrhuuuuwnbdg0
2013-08-19 19:49:30 +02:00
Christophe Simonis 815fc8f84a [FIX] browse records do not try to prefetch fields user can't read
bzr revid: chs@openerp.com-20130819164622-7cre7yqpvlyzsslj
2013-08-19 18:46:22 +02:00
Martin Trigaux 3393aa645c [FIX] res_currency: update linked tests
bzr revid: mat@openerp.com-20130731111054-g5p094izprzok3eo
2013-07-31 13:10:54 +02:00
Olivier Dony e608027256 [FIX] openerp/tests/test_mail.py marked executable as it should
lp bug: https://launchpad.net/bugs/993414 fixed

bzr revid: odo@openerp.com-20130517102933-u1u4n2ad5jxnndw5
2013-05-17 12:29:33 +02:00
Xavier Morel 4a9d82621e [IMP] don't log from import when converting psycopg exceptions to output messages
add conversion for unique constraints, test behavior on unique constraint failure

bzr revid: xmo@openerp.com-20130211143647-l16ssw9z73stbgyc
2013-02-11 15:36:47 +01:00
Christophe Matthieu 21c5425d89 [IMP] mail_sanitize: simplification of the regular expression
bzr revid: chm@openerp.com-20130102162544-jfwdfqx2ruf0x1q2
2013-01-02 17:25:44 +01:00
Christophe Matthieu 6a07b69889 [IMP] html_sanitize: test with assertIn
bzr revid: chm@openerp.com-20130102161458-4pvpvfb1shmt0sjy
2013-01-02 17:14:58 +01:00
Christophe Matthieu a4e7fa97f4 [IMP] mail sanitize: add special email address for escape in the sanitizer
bzr revid: chm@openerp.com-20130102090040-yh0vdv8b3mtwoebh
2013-01-02 10:00:40 +01:00
Christophe Matthieu 71a92f46e4 [FIX] tools: html_sanitize
bzr revid: chm@openerp.com-20121231154451-0guqjid92rfndghp
2012-12-31 16:44:51 +01:00
Thibault Delavallée be5118c704 [DOC] Added some comments. Updated failure message. Added a logging message when not capable of parsing.
bzr revid: tde@openerp.com-20121226164354-tjquf1zdyr90tl5e
2012-12-26 17:43:54 +01:00
Thibault Delavallée d7185be38c [IMP] html_sanitize: now uses the builtin cleaner of lxml.html. We also allows style attribute; the cleaner ensures no javascript or malicious code goes through those attributes. Updated and added tests for the sanitizer, especially about malicious code, and EDI-like html code.
bzr revid: tde@openerp.com-20121226162505-8rq060p375z1k9il
2012-12-26 17:25:05 +01:00
Christophe Matthieu db028dc09a [MERGE] tools mail: Return the initial variable if is false or if is not an instance of basestring. Remove encoding attribute in html tags.
bzr revid: chm@openerp.com-20121221083527-py3wr2syz5d8igv8
2012-12-21 09:35:27 +01:00
Antony Lesuisse 549c011893 [MERGE] turnk
bzr revid: al@openerp.com-20121220020708-ioiaoz58ncgw5wg7
2012-12-20 03:07:08 +01:00
Christophe Matthieu bf11573436 [IMP] tools mail: encoding : add test for removing encoding attribute
bzr revid: chm@openerp.com-20121219143912-os160iv0q0jeyhld
2012-12-19 15:39:12 +01:00
Christophe Matthieu a31af13a3e [IMP] tools mail: add test message with xml and doctype tags don't crash
bzr revid: chm@openerp.com-20121219111853-zj16hdg7ujakksqt
2012-12-19 12:18:53 +01:00
Cecile Tonglet 5f0070dcb6 [FIX] Remove unused imports and fix some imports that doesn't use the new namespace
bzr revid: cto@openerp.com-20121217143029-e9ki4ftwihq7pdme
2012-12-17 15:30:29 +01:00
Raphael Collet eecc7de437 [MERGE] trunk-acl-thu (check read/write access restrictions on fields with a groups attribute)
bzr revid: rco@openerp.com-20121217101528-nt5hsjvvodaap57m
2012-12-17 11:15:28 +01:00
Antony Lesuisse 9568552636 revert test change will be moved to an other branch
bzr revid: al@openerp.com-20121216193932-foluon7b5bqqvrib
2012-12-16 20:39:32 +01:00
Antony Lesuisse 70aa2c995a filestore testcase and fix bugs
bzr revid: al@openerp.com-20121216190317-xoz0jij2cfk0c2zk
2012-12-16 20:03:17 +01:00
Antony Lesuisse 2569587c90 Simplify openerp testing, deprecated redondant test declaration, we feed all
tests.* modules to unittest2.TestLoader.loadTestsFromModule(module)

bzr revid: al@openerp.com-20121216173856-euntlfi80uzutkp0
2012-12-16 18:38:56 +01:00
Vo Minh Thu eb0fcc35d2 [FIX] check_field_access_rights: ignore nonexisting fields
It seems name_alias is requested but does not exist.

bzr revid: vmt@openerp.com-20121212151509-22494edob4e3fqaf
2012-12-12 16:15:09 +01:00
Vo Minh Thu 1a4fd71880 [FIX] test_fields: _all_columns must be modified similarly to _columns.
(Because of the newly added method check_field_access_rights().)

bzr revid: vmt@openerp.com-20121212134755-ykfdykqepwzti5uf
2012-12-12 14:47:55 +01:00
Vo Minh Thu 9d2afcae3f [IMP] orm: check groups-based access rights on model fields in read() and write().
The commented-out tests present in test_acl.py now pass.
Other tests now fail :-(.

bzr revid: vmt@openerp.com-20121212113647-11y3buulifg6tyhj
2012-12-12 12:36:47 +01:00
Christophe Simonis ea542472c9 [FIX] res.partner: column "address" does not exists anymore.
bzr revid: chs@openerp.com-20121211184624-b7v3ffn0jsoa1jbq
2012-12-11 19:46:24 +01:00
Vo Minh Thu 055f46f290 [IMP] tests: add test_acl to the openerp.tests suite.
bzr revid: vmt@openerp.com-20121211122844-6y060gex2lbq76hp
2012-12-11 13:28:44 +01:00
Thibault Delavallée 50cf6d4008 [CLEAN] Query: cleaned a bit the code. All joins now goes through the same method, either implicit or explicit. Will have to be upgraded in future versions, but at least this is a bit centralized. Updated ORM accordingly. Updated tests. Added a get_alias_from_query method in expression that find the table and the alias from a 'full alias' statement.
bzr revid: tde@openerp.com-20121207154204-mx036lpj3vdclu77
2012-12-07 16:42:04 +01:00
Thibault Delavallée efc6e78d25 [IMP] [MOV] Moved test_osv and test_translate from unchecked test directory to tests, to be now effectively run. Updated test_osv to matche the new alias coding style.
bzr revid: tde@openerp.com-20121207142931-6ll5yduitdk3ijes
2012-12-07 15:29:31 +01:00
Thibault Delavallée 9e6c2805ab [REF] [IMP] expression.parse: refactored the main parsing loop, now using source and result stacks. Leaf elements are encapsulated into a specific object, allowing to delegate the join condition formation and aliases generation, as well as working_table management to them. The main parsing loop is now a loop taking a leaf, doing one action on it, and putting the result back to be analyzed or in the results. This allows to avoid having while loops inside a main while loop with some weird corner effects.
bzr revid: tde@openerp.com-20121204142650-gkhmjdeu5upi25kp
2012-12-04 15:26:50 +01:00
Fabien Meghazi 69a09cc2fb [FIX] Ensure timzone is unset before testing
bzr revid: fme@openerp.com-20121128174318-wg0oygtj3eipozp2
2012-11-28 18:43:18 +01:00
Christophe Matthieu 50f09660fb [FIX] tools mail: html_email_clean return False (standard OpenERP) if the param is False
bzr revid: chm@openerp.com-20121120134001-ivw9dqxha2du70o6
2012-11-20 14:40:01 +01:00
Christophe Matthieu ceefb58670 [IMP] tools mail: remove one line test (double)
bzr revid: chm@openerp.com-20121120100225-it12j6qgxjn3ilbg
2012-11-20 11:02:25 +01:00
Christophe Matthieu f8a44b2bac [FIX] tools.mail: html_email_clean test type and value of empty value
bzr revid: chm@openerp.com-20121119152615-sazfnlc5uwiw0ut9
2012-11-19 16:26:15 +01:00
Christophe Matthieu a4b831e3ed [FIX] tools.mail: html_email_clean test type of empty value
bzr revid: chm@openerp.com-20121119152446-w1z1vuhfk631h0ko
2012-11-19 16:24:46 +01:00
Christophe Matthieu b4dc178588 [IMP] tools.mail: add a test for html_email_clean function, if empty string
bzr revid: chm@openerp.com-20121119151739-vcofz0abk7i71b3l
2012-11-19 16:17:39 +01:00
Vo Minh Thu 35ec3e6d5b [IMP] test_limits/test_uninstall: added access rules.
bzr revid: vmt@openerp.com-20121116131439-y14dekyogidxymof
2012-11-16 14:14:39 +01:00
Vo Minh Thu 8846c8e67b [IMP] test_exceptions/test_impex: added access rules.
bzr revid: vmt@openerp.com-20121116100505-9uakbl4klbkaz95k
2012-11-16 11:05:05 +01:00
Vo Minh Thu 147fae832a [FIX] test_db_cursor: explicitely close the cursor (without relying on __del__).
bzr revid: vmt@openerp.com-20121115123937-keq4eb2a3n85x0rv
2012-11-15 13:39:37 +01:00
Vo Minh Thu 08a2115754 [IMP] removing some warnings (those one are generated by tests).
bzr revid: vmt@openerp.com-20121115115759-toz6g9jcephwxmin
2012-11-15 12:57:59 +01:00
Thibault Delavallée f0569f7133 [MERGE] Tools: mail.py: (E)Mail management
Refactored a bit openerp/tools about (e)mails and html.
- moved some (e)mail related functions from misc to mail
- moved html_sanitizer into mail
- added html_email_clean, to clean incoming emails (remove quotes, signature)
- added a plaintext2html function, to convert plaintext into html (\n and \r are replaced by <br/>, more than two <br/> are replaced by end and beginning of paragraphs)
- append_content_to_html now uses plaintext2html, according to some new flags
- added tests for html_email_clean, plaintext2html, updated test for append_content_to_html, html_sanitize

bzr revid: tde@openerp.com-20121114150442-4rpfdy9spm1ig0qw
2012-11-14 16:04:42 +01:00
Thibault Delavallée 8e15ab0dff [FIX] Typo in tests.
bzr revid: tde@openerp.com-20121114135159-nouaj72drtot5hiv
2012-11-14 14:51:59 +01:00