|
@ -13,6 +13,16 @@ class TestResUsers(TransactionCase): |
|
|
|
|
|
|
|
|
def setUp(self): |
|
|
def setUp(self): |
|
|
super(TestResUsers, self).setUp() |
|
|
super(TestResUsers, self).setUp() |
|
|
|
|
|
self.main_comp = self.env.ref('base.main_company') |
|
|
|
|
|
# Modify users as privileged, but non-root user |
|
|
|
|
|
privileged_user = self.env['res.users'].create({ |
|
|
|
|
|
'name': 'Privileged User', |
|
|
|
|
|
'login': 'privileged_user@example.com', |
|
|
|
|
|
'company_id': self.main_comp.id, |
|
|
|
|
|
'groups_id': [(4, self.env.ref('base.group_erp_manager').id)], |
|
|
|
|
|
}) |
|
|
|
|
|
privileged_user.email = privileged_user.login |
|
|
|
|
|
self.env = self.env(user=privileged_user) |
|
|
self.login = 'foslabs@example.com' |
|
|
self.login = 'foslabs@example.com' |
|
|
self.partner_vals = { |
|
|
self.partner_vals = { |
|
|
'name': 'Partner', |
|
|
'name': 'Partner', |
|
@ -20,7 +30,6 @@ class TestResUsers(TransactionCase): |
|
|
'email': self.login, |
|
|
'email': self.login, |
|
|
} |
|
|
} |
|
|
self.password = 'asdQWE123$%^' |
|
|
self.password = 'asdQWE123$%^' |
|
|
self.main_comp = self.env.ref('base.main_company') |
|
|
|
|
|
self.vals = { |
|
|
self.vals = { |
|
|
'name': 'User', |
|
|
'name': 'User', |
|
|
'login': self.login, |
|
|
'login': self.login, |
|
|