From 9529c144a44dedaa19a7484ca7f425ee238985a2 Mon Sep 17 00:00:00 2001 From: hurrinico Date: Wed, 12 Nov 2014 11:33:04 +0100 Subject: [PATCH] [FIX] First Change to test --- field_validator/test/validator.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/field_validator/test/validator.yml b/field_validator/test/validator.yml index 0d3ed8464..f365f9c2d 100644 --- a/field_validator/test/validator.yml +++ b/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'})