Create record by XML for test with readonly transaction
issue10936
This commit is contained in:
1 parent
7d879abef6
commit
d608167f04
3 files changed
+11
-2
No files matched your search
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="test.function.getter_context" id="field_function_getter_context">
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
@@ -52,8 +52,7 @@ class FieldFunctionTestCase(unittest.TestCase):
|
||||
|
||||
with Transaction().new_transaction(readonly=True), \
|
||||
patch.object(Model, 'getter') as getter:
|
||||
record = Model()
|
||||
record.save()
|
||||
record, = Model.search([], limit=1)
|
||||
record.function_with_context
|
||||
record.function_without_context
|
||||
self.assertEqual(getter.call_count, 2)
|
||||
|
||||
@@ -8,4 +8,5 @@ xml:
|
||||
workflow.xml
|
||||
wizard.xml
|
||||
modelview.xml
|
||||
field_function.xml
|
||||
message.xml
|
||||
Reference in new issue
Block a user