Browse Source

[FIX] restore form . import statement

pull/347/head
Nicolas JEUDY 8 years ago
parent
commit
0db19053b3
  1. 2
      partner_contact_in_several_companies/__init__.py
  2. 2
      partner_contact_in_several_companies/tests/__init__.py
  3. 18
      partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py

2
partner_contact_in_several_companies/__init__.py

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import models
from . import models

2
partner_contact_in_several_companies/tests/__init__.py

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import test_partner_contact_in_several_companies
from . import test_partner_contact_in_several_companies

18
partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py

@ -79,7 +79,7 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
def read_other_contacts(pid, context=None):
return self.partner.read(
cr, uid, [pid], ['other_contact_ids'])[0]['other_contact_ids']
[pid], ['other_contact_ids'])[0]['other_contact_ids']
def read_contacts(pid, context=None):
return self.partner.read(
@ -180,25 +180,25 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
{'contact_id': self.bob_contact_id, 'name': 'Rob Egnops'}
)
self.assertEqual(
self.partner.browse(new_contact_id).name,
new_contact_id.name,
'Bob Egnops'
)
# Reset contact to standalone
self.partner.write(cr, uid, [new_contact_id], {'contact_id': False})
new_contact_id.write({'contact_id': False})
self.assertEqual(
self.partner.browse(new_contact_id).contact_type,
new_contact_id.contact_type,
'standalone',
)
# Reset contact to attached, and ensure only it is unlinked (i.e.
# context is ignored).
self.partner.write(cr, uid, [new_contact_id],
new_contact_id.write([
{'contact_id': self.bob_contact_id})
ctx = {'search_show_all_positions': {'is_set': True,
'set_value': True
}}
self.partner.unlink([new_contact_id])
new_contact_id.with_context(ctx).unlink()
partner_ids = self.partner.search(
[('id', 'in', [new_contact_id, self.bob_contact_id])])
self.assertIn(self.bob_contact_id, partner_ids)
@ -210,8 +210,8 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
"""
# Test DOWNSTREAM sync
self.partner.write(
[self.bob_contact_id], {'name': 'Rob Egnops'}
self.bob_contact_id.write(
{'name': 'Rob Egnops'}
)
self.assertEqual(
self.partner.browse(self.bob_job1_id).name,
@ -219,7 +219,7 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
)
# Test UPSTREAM sync
self.partner.write([self.bob_job1_id], {'name': 'Bob Egnops'})
self.bob_job1_id.write({'name': 'Bob Egnops'})
self.assertEqual(
self.partner.browse(self.bob_contact_id).name,
'Bob Egnops',

Loading…
Cancel
Save