mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-18 17:32:03 +02:00
16.0 vanila
This commit is contained in:
parent
956889352c
commit
2e65bf056a
17 changed files with 5293 additions and 17668 deletions
|
|
@ -1512,6 +1512,42 @@ class TestTemplating(ViewCase):
|
|||
" the main view's"
|
||||
)
|
||||
|
||||
def test_branding_remove_add_text(self):
|
||||
view1 = self.View.create({
|
||||
'name': "Base view",
|
||||
'type': 'qweb',
|
||||
'arch': """<root>
|
||||
<item order="1">
|
||||
<item/>
|
||||
</item>
|
||||
</root>""",
|
||||
})
|
||||
view2 = self.View.create({
|
||||
'name': "Extension",
|
||||
'type': 'qweb',
|
||||
'inherit_id': view1.id,
|
||||
'arch': """
|
||||
<data>
|
||||
<xpath expr="/root/item/item" position="replace" />
|
||||
<xpath expr="/root/item" position="inside">A<div/>B</xpath>
|
||||
</data>
|
||||
"""
|
||||
})
|
||||
|
||||
arch_string = view1.with_context(inherit_branding=True).get_combined_arch()
|
||||
arch = etree.fromstring(arch_string)
|
||||
self.View.distribute_branding(arch)
|
||||
|
||||
expected = etree.fromstring(f"""
|
||||
<root>
|
||||
<item order="1">
|
||||
A
|
||||
<div data-oe-id="{view2.id}" data-oe-xpath="/data/xpath[2]/div" data-oe-model="ir.ui.view" data-oe-field="arch"/>
|
||||
B
|
||||
</item>
|
||||
</root>
|
||||
""")
|
||||
self.assertEqual(arch, expected)
|
||||
|
||||
class TestViews(ViewCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue