Skip to content

Commit

Permalink
Fix bug OCA#154.
Browse files Browse the repository at this point in the history
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
Jairo Llopis authored and edlopen committed Mar 1, 2024
1 parent 61fc53e commit 30b7d53
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
5 changes: 3 additions & 2 deletions partner_firstname/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
{
'name': 'Partner first name and last name',
'summary': "Split first name and last name for non company partners",
'version': '8.0.2.0.1',
'version': '8.0.2.1.0',
'author': "Camptocamp, Grupo ESOC, Odoo Community Association (OCA)",
"license": "AGPL-3",
'maintainer': 'Camptocamp, Acsone',
'category': 'Extra Tools',
'website': 'http://www.camptocamp.com, http://www.acsone.eu',
'website':
'http://www.camptocamp.com, http://www.acsone.eu, http://grupoesoc.es',
'depends': ['base'],
'data': [
'views/res_partner.xml',
Expand Down
9 changes: 8 additions & 1 deletion partner_firstname/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,11 @@
#
##############################################################################

from . import test_create, test_defaults, test_empty, test_name, test_onchange
from . import (
test_create,
test_defaults,
test_delete,
test_empty,
test_name,
test_onchange
)
3 changes: 2 additions & 1 deletion partner_firstname/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def tearDown(self):
def test_copy(self):
"""Copy the partner and compare the result."""
self.expect(self.lastname, u"%s (copy)" % self.firstname)
self.changed = self.original.with_context(copy=True, lang="en_US").copy()
self.changed = (self.original.with_context(copy=True, lang="en_US")
.copy())

def test_one_name(self):
"""Test what happens when only one name is given."""
Expand Down
5 changes: 3 additions & 2 deletions partner_firstname/tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ class CompanyCase(PersonCase):
context = {"default_is_company": True}

def setUp(self):
return super(CompanyCase, self).setUp()
self.values.update(lastname=self.values["name"], firstname=False)
super(CompanyCase, self).setUp()
self.good_values.update(lastname=self.values["name"], firstname=False)
self.values = self.good_values.copy()


class UserCase(PersonCase, MailInstalled):
Expand Down
12 changes: 6 additions & 6 deletions partner_firstname/tests/test_delete.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright 2015 Grupo ESOC
# -*- coding: utf-8 -*-
# © 2015 Grupo ESOC
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo.tests.common import TransactionCase

from openerp.tests.common import TransactionCase
from .base import MailInstalled


Expand All @@ -18,10 +18,10 @@ def test_computing_after_unlink(self):
See https://github.com/OCA/partner-contact/issues/154.
"""
data = {"name": "Söme name"}
data = {"name": u"Söme name"}
record = self.env[self.model].with_context(**self.context).create(data)
record.unlink()
record.flush_recordset()
record.recompute()


class PersonCase(CompanyCase):
Expand All @@ -35,4 +35,4 @@ class UserCase(CompanyCase, MailInstalled):
def test_computing_after_unlink(self):
# Cannot create users if ``mail`` is installed
if not self.mail_installed():
return super(UserCase, self).test_computing_after_unlink()
super(UserCase, self).test_computing_after_unlink()

0 comments on commit 30b7d53

Please sign in to comment.