From e4decaed7990c3fbca654a9adce8a406cf5f4b42 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 18 May 2015 09:37:53 +0200 Subject: [PATCH] Rename exception according to PEP8. --- partner_firstname/exceptions.py | 2 +- partner_firstname/models.py | 2 +- partner_firstname/tests/test_partner_firstname.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/partner_firstname/exceptions.py b/partner_firstname/exceptions.py index 226ddb09d..d13072422 100644 --- a/partner_firstname/exceptions.py +++ b/partner_firstname/exceptions.py @@ -19,7 +19,7 @@ from openerp import _, exceptions -class EmptyNames(exceptions.ValidationError): +class EmptyNamesError(exceptions.ValidationError): def __init__(self, record, value=_("No name is set.")): self.record = record self._value = value diff --git a/partner_firstname/models.py b/partner_firstname/models.py index b8ccaaea5..993f2d06d 100644 --- a/partner_firstname/models.py +++ b/partner_firstname/models.py @@ -74,7 +74,7 @@ class ResPartner(models.Model): def _check_name(self): """Ensure at least one name is set.""" if not (self.firstname or self.lastname): - raise exceptions.EmptyNames(self) + raise exceptions.EmptyNamesError(self) @api.model def _firstname_install(self): diff --git a/partner_firstname/tests/test_partner_firstname.py b/partner_firstname/tests/test_partner_firstname.py index 8415b129f..96092c1fc 100644 --- a/partner_firstname/tests/test_partner_firstname.py +++ b/partner_firstname/tests/test_partner_firstname.py @@ -90,7 +90,7 @@ class PartnerFirstnameCase(TransactionCase): def test_no_names(self): """Test that you cannot set a partner without names.""" - with self.assertRaises(ex.EmptyNames): + with self.assertRaises(ex.EmptyNamesError): self.original.firstname = self.original.lastname = False