From 9734c0826086d60bd5d4ae3f77f57ac728236f9f Mon Sep 17 00:00:00 2001 From: sebalix Date: Mon, 9 Feb 2015 12:09:07 +0100 Subject: [PATCH] [IMP] Module 'auditlog' - Add a test regarding a resource deleted through a (2, ID) tuple on a write operation --- auditlog/tests/test_auditlog.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/auditlog/tests/test_auditlog.py b/auditlog/tests/test_auditlog.py index 6869f69fd..42c4b2ccc 100644 --- a/auditlog/tests/test_auditlog.py +++ b/auditlog/tests/test_auditlog.py @@ -60,3 +60,18 @@ class TestAuditlog(TransactionCase): self.env['res.groups'].create({ 'name': 'testgroup2', }) + + def test_LogCreation3(self): + """Third test, two groups, the latter being the parent of the former. + Then we remove it right after (with (2, X) tuple) to test the creation + of a 'write' log with a deleted resource (so with no text + representation). + """ + testgroup3 = self.env['res.groups'].create({ + 'name': 'testgroup3', + }) + testgroup4 = self.env['res.groups'].create({ + 'name': 'testgroup4', + 'implied_ids': [(4, testgroup3.id)], + }) + testgroup4.write({'implied_ids': [(2, testgroup3.id)]})