From 3b6b39de821d68684e34a7c314ab75accdbfbbee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 25 Dec 2025 09:54:24 +0100 Subject: [PATCH] Use ID read of note in tests Closes #14450 --- trytond/trytond/tests/test_resource.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/trytond/trytond/tests/test_resource.py b/trytond/trytond/tests/test_resource.py index 7c0f3fae8a..623465b468 100644 --- a/trytond/trytond/tests/test_resource.py +++ b/trytond/trytond/tests/test_resource.py @@ -125,13 +125,13 @@ class ResourceTestCase(TestCase): record, = Resource.create([{}]) with Transaction().set_context(_check_access=True): - note_id, = Note.create([{ + note, = Note.create([{ 'resource': record, 'message': "Foo", }]) - Note.write([note_id], {'message': "Bar"}) - Note.read([note_id], ['message']) - Note.delete([note_id]) + Note.write([note], {'message': "Bar"}) + Note.read([note.id], ['message']) + Note.delete([note]) @with_transaction() def test_resource_without_access(self): @@ -189,13 +189,13 @@ class ResourceTestCase(TestCase): record, = Resource.create([{}]) with Transaction().set_context(_check_access=True): - note_id, = Note.create([{ + note, = Note.create([{ 'resource': record, 'message': "Foo", }]) - Note.write([note_id], {'message': "Bar"}) - Note.read([note_id], ['message']) - Note.delete([note_id]) + Note.write([note], {'message': "Bar"}) + Note.read([note.id], ['message']) + Note.delete([note]) @with_transaction() def test_resource_without_rule(self): @@ -217,7 +217,7 @@ class ResourceTestCase(TestCase): }]) record, = Resource.create([{}]) - note_id, = Note.create([{ + note, = Note.create([{ 'resource': record, 'message': "Message", }]) @@ -230,8 +230,8 @@ class ResourceTestCase(TestCase): }]) with self.assertRaises(AccessError): - Note.write([note_id], {'message': "Bar"}) + Note.write([note], {'message': "Bar"}) with self.assertRaises(AccessError): - Note.read([note_id], ['message']) + Note.read([note.id], ['message']) with self.assertRaises(AccessError): - Note.delete([note_id]) + Note.delete([note])