You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SunjiERP/odoo/tests/test_parse_inline_template.py

19 lines
631 B
Python

8 months ago
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import BaseCase
from odoo.tools.rendering_tools import parse_inline_template
class TestParseInlineTemplate(BaseCase):
def test_no_expression(self):
text = 'a b c'
self.assertEqual(parse_inline_template(text), [('a b c', '')])
def test_expression1(self):
text = 'a {{b}}'
self.assertEqual(parse_inline_template(text), [('a ', 'b')])
def test_expression2(self):
text = 'a {{b}} c'
self.assertEqual(parse_inline_template(text), [('a ', 'b'), (' c', '')])