forked from Vauxoo/partner-contact
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: partner_firstname/__openerp__.py partner_firstname/tests/__init__.py Fix flake8 error After all, this was just a workaround. Remove it. The real fix was in OCA#171. I leave the tests. Fix test that was having sentences after return. PEP8 fix.
- Loading branch information
1 parent
d098f0b
commit 402a40d
Showing
5 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015 Grupo ESOC | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from openerp.tests.common import TransactionCase | ||
from .base import MailInstalled | ||
|
||
|
||
class CompanyCase(TransactionCase): | ||
model = "res.partner" | ||
context = {"default_is_company": True} | ||
|
||
def test_computing_after_unlink(self): | ||
"""Test what happens if recomputed after unlinking. | ||
This test might seem useless, but really this happens when module | ||
``partner_relations`` is installed. | ||
See https://github.com/OCA/partner-contact/issues/154. | ||
""" | ||
data = {"name": u"Söme name"} | ||
record = self.env[self.model].with_context(**self.context).create(data) | ||
record.unlink() | ||
record.recompute() | ||
|
||
|
||
class PersonCase(CompanyCase): | ||
context = {"default_is_company": False} | ||
|
||
|
||
class UserCase(CompanyCase, MailInstalled): | ||
model = "res.users" | ||
context = {"default_login": "user@example.com"} | ||
|
||
def test_computing_after_unlink(self): | ||
# Cannot create users if ``mail`` is installed | ||
if not self.mail_installed(): | ||
super(UserCase, self).test_computing_after_unlink() |