← Back to team overview

openerp-community-reviewer team mailing list archive

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

 

Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/ocb-server/7.0-lp1194893-fix_tests into lp:ocb-server.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1194893 in OpenERP Community Backports (Server): "[7.0] Export creates xml id based on wrong table name"
  https://bugs.launchpad.net/ocb-server/+bug/1194893

For more details, see:
https://code.launchpad.net/~therp-nl/ocb-server/7.0-lp1194893-fix_tests/+merge/192597

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']]
?                       ^^ ^^^^


-- 
https://code.launchpad.net/~therp-nl/ocb-server/7.0-lp1194893-fix_tests/+merge/192597
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~therp-nl/ocb-server/7.0-lp1194893-fix_tests into lp:ocb-server.
=== modified file 'openerp/tests/addons/test_impex/tests/test_export.py'
--- openerp/tests/addons/test_impex/tests/test_export.py	2012-09-07 12:08:04 +0000
+++ openerp/tests/addons/test_impex/tests/test_export.py	2013-10-24 21:50:41 +0000
@@ -309,8 +309,9 @@
     def test_external_id(self):
         integer_id = self.registry('export.integer').create(
             self.cr, openerp.SUPERUSER_ID, {'value': 42})
-        # __export__.$class.$id
-        external_id = u'__export__.export_many2one_%d' % integer_id
+        # Expecting the m2o target model name in the external id,
+        # not this model's name
+        external_id = u'__export__.export_integer_%d' % integer_id
         self.assertEqual(
             self.export(integer_id, fields=['value/id']),
             [[external_id]])


Follow ups