From 3393aa645c82a395024519a97b14572e9db18d06 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 31 Jul 2013 13:10:54 +0200 Subject: [PATCH] [FIX] res_currency: update linked tests bzr revid: mat@openerp.com-20130731111054-g5p094izprzok3eo --- openerp/tests/test_acl.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/openerp/tests/test_acl.py b/openerp/tests/test_acl.py index 1d8d6bfb22a..9f9019e5db9 100644 --- a/openerp/tests/test_acl.py +++ b/openerp/tests/test_acl.py @@ -29,18 +29,18 @@ class TestACL(common.TransactionCase): view_arch = etree.fromstring(form_view.get('arch')) has_tech_feat = self.res_users.has_group(self.cr, self.demo_uid, GROUP_TECHNICAL_FEATURES) self.assertFalse(has_tech_feat, "`demo` user should not belong to the restricted group before the test") - self.assertTrue('rate' in original_fields, "'rate' field must be properly visible before the test") - self.assertNotEquals(view_arch.xpath("//field[@name='rate']"), [], - "Field 'rate' must be found in view definition before the test") + self.assertTrue('accuracy' in original_fields, "'accuracy' field must be properly visible before the test") + self.assertNotEquals(view_arch.xpath("//field[@name='accuracy']"), [], + "Field 'accuracy' must be found in view definition before the test") # Restrict access to the field and check it's gone - self.res_currency._columns['rate'].groups = GROUP_TECHNICAL_FEATURES + self.res_currency._columns['accuracy'].groups = GROUP_TECHNICAL_FEATURES fields = self.res_currency.fields_get(self.cr, self.demo_uid, []) form_view = self.res_currency.fields_view_get(self.cr, self.demo_uid, False, 'form') view_arch = etree.fromstring(form_view.get('arch')) - self.assertFalse('rate' in fields, "'rate' field should be gone") - self.assertEquals(view_arch.xpath("//field[@name='rate']"), [], - "Field 'rate' must not be found in view definition") + self.assertFalse('accuracy' in fields, "'accuracy' field should be gone") + self.assertEquals(view_arch.xpath("//field[@name='accuracy']"), [], + "Field 'accuracy' must not be found in view definition") # Make demo user a member of the restricted group and check that the field is back self.tech_group.write({'users': [(4, self.demo_uid)]}) @@ -50,13 +50,13 @@ class TestACL(common.TransactionCase): view_arch = etree.fromstring(form_view.get('arch')) #import pprint; pprint.pprint(fields); pprint.pprint(form_view) self.assertTrue(has_tech_feat, "`demo` user should now belong to the restricted group") - self.assertTrue('rate' in fields, "'rate' field must be properly visible again") - self.assertNotEquals(view_arch.xpath("//field[@name='rate']"), [], - "Field 'rate' must be found in view definition again") + self.assertTrue('accuracy' in fields, "'accuracy' field must be properly visible again") + self.assertNotEquals(view_arch.xpath("//field[@name='accuracy']"), [], + "Field 'accuracy' must be found in view definition again") #cleanup self.tech_group.write({'users': [(3, self.demo_uid)]}) - self.res_currency._columns['rate'].groups = False + self.res_currency._columns['accuracy'].groups = False @mute_logger('openerp.osv.orm') def test_field_crud_restriction(self):