Browse Source

[FIX] First Change to test

pull/84/head
hurrinico 10 years ago
committed by eLBati
parent
commit
9529c144a4
  1. 5
      field_validator/test/validator.yml

5
field_validator/test/validator.yml

@ -2,6 +2,11 @@
Try fields validator
-
!python {model: ir.model.field}: |
from nose.tools import *
from openerp.exceptions import Warning
field_ids = self.search(cr, uid, [('name', '=', 'email'), ('model', '=', 'res.partner')]
assert len(field_ids) == 1, 'There must be 1 email field'
self.write(cr, uid, field_ids, {'regex_validator': r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b'}
partner_id = self.pool.get('res.partner').create(cr, uid, {'name': 'test_partner'})
with assert_raises(Error):
self.pool.get('res.partner').write(cr, uid, partner_id, {'email': 'jhon'})
Loading…
Cancel
Save