From d55a2372de4103c6287120f5b242c3ac1296a2bc Mon Sep 17 00:00:00 2001 From: sebalix Date: Wed, 4 Feb 2015 15:21:03 +0100 Subject: [PATCH] [IMP] Module 'auditlog' - Added a second test using cached data generated during the first test --- auditlog/tests/test_auditlog.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/auditlog/tests/test_auditlog.py b/auditlog/tests/test_auditlog.py index f2bf79745..6869f69fd 100644 --- a/auditlog/tests/test_auditlog.py +++ b/auditlog/tests/test_auditlog.py @@ -23,6 +23,7 @@ from openerp.tests.common import TransactionCase class TestAuditlog(TransactionCase): def test_LogCreation(self): + """First test, caching some data.""" auditlog_log = self.env['auditlog.log'] groups_model_id = self.env.ref('base.model_res_groups').id self.env['auditlog.rule'].create({ @@ -34,14 +35,14 @@ class TestAuditlog(TransactionCase): 'state': 'subscribed', }) group = self.env['res.groups'].create({ - 'name': 'testgroup', + 'name': 'testgroup1', }) self.assertTrue(auditlog_log.search([ ('model_id', '=', groups_model_id), ('method', '=', 'create'), ('res_id', '=', group.id), ])) - group.write({'name': 'Testgroup'}) + group.write({'name': 'Testgroup1'}) self.assertTrue(auditlog_log.search([ ('model_id', '=', groups_model_id), ('method', '=', 'write'), @@ -53,3 +54,9 @@ class TestAuditlog(TransactionCase): ('method', '=', 'unlink'), ('res_id', '=', group.id), ])) + + def test_LogCreation2(self): + """Second test, using cached data of the first one.""" + self.env['res.groups'].create({ + 'name': 'testgroup2', + })