Browse Source

[FIX] Prevent error msg in test with context hack

pull/68/head
Stefan Rijnhart 9 years ago
parent
commit
7a50b2eff9
  1. 2
      base_phone/base_phone.py
  2. 2
      base_phone/test/phonenum.yml

2
base_phone/base_phone.py

@ -103,6 +103,8 @@ class PhoneCommon(models.AbstractModel):
# by a user via the Web interface # by a user via the Web interface
# logger is usefull when the record is created/written # logger is usefull when the record is created/written
# via the webservices # via the webservices
# Just don't generate this error message during testing
if not context.get('yml_test'):
_logger.error( _logger.error(
"Cannot reformat the phone number '%s' to " "Cannot reformat the phone number '%s' to "
"international format with region=%s" "international format with region=%s"

2
base_phone/test/phonenum.yml

@ -16,7 +16,7 @@
- -
Write invalid phone number Write invalid phone number
- -
!record {model: res.partner, id: partner3}:
!record {model: res.partner, id: partner3, context: {"yml_test": True}}:
name: Jean Badphone name: Jean Badphone
phone: 42 phone: 42
- -

Loading…
Cancel
Save