Merge lp:~therp-nl/ocb-server/7.0-lp1194893-fix_tests into lp:ocb-server

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 5134
Proposed branch: lp:~therp-nl/ocb-server/7.0-lp1194893-fix_tests
Merge into: lp:ocb-server
Diff against target: 15 lines (+3/-2)
1 file modified
openerp/tests/addons/test_impex/tests/test_export.py (+3/-2)
To merge this branch: bzr merge lp:~therp-nl/ocb-server/7.0-lp1194893-fix_tests
Reviewer Review Type Date Requested Status
Christophe CHAUVET code review, no test Approve
Holger Brunn (Therp) code review Approve
Pedro Manuel Baeza code review, no test Approve
Review via email: mp+192597@code.launchpad.net

Commit message

[FIX] Generates external ids based on the actual model's name in the case of relation fields

Description of the change

This branch fixes a failing test due to the fix for lp:1194893. This fix generates external ids based on the actual model's name in the case of relation fields. The failing test expected to find the source model's name in the external id, not the m2o target model name.

======================================================================
FAIL: test_external_id (openerp.addons.test_impex.tests.test_export.test_m2o)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/oerstfdev70/openobject-server/openerp/tests/addons/test_impex/tests/test_export.py", line 316, in test_external_id
    [[external_id]])
AssertionError: Lists differ: [[u'__export__.export_integer_... != [[u'__export__.export_many2one...

First differing element 0:
[u'__export__.export_integer_65']
[u'__export__.export_many2one_65']

- [[u'__export__.export_integer_65']]
? ^ ^ ---

+ [[u'__export__.export_many2one_65']]
? ^^ ^^^^

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

Stefan, it's good to see that you are already working of fixing tests problems.

Thank you for your always valuable work.

Regards.

review: Approve (code review, no test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi

Explanation is OK for me

Regards,

LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/tests/addons/test_impex/tests/test_export.py'
2--- openerp/tests/addons/test_impex/tests/test_export.py 2012-09-07 12:08:04 +0000
3+++ openerp/tests/addons/test_impex/tests/test_export.py 2013-10-24 21:52:26 +0000
4@@ -309,8 +309,9 @@
5 def test_external_id(self):
6 integer_id = self.registry('export.integer').create(
7 self.cr, openerp.SUPERUSER_ID, {'value': 42})
8- # __export__.$class.$id
9- external_id = u'__export__.export_many2one_%d' % integer_id
10+ # Expecting the m2o target model name in the external id,
11+ # not this model's name
12+ external_id = u'__export__.export_integer_%d' % integer_id
13 self.assertEqual(
14 self.export(integer_id, fields=['value/id']),
15 [[external_id]])

Subscribers

People subscribed via source and target branches

to status/vote changes: