test_views.py 1.9 KB

1234567891011121314151617181920212223
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo.tests import common
  4. from lxml import etree
  5. class TestDefaultView(common.TransactionCase):
  6. def test_default_form_view(self):
  7. self.assertEqual(
  8. etree.tostring(self.env['test_new_api.message']._get_default_form_view()),
  9. b'<form><sheet string="Test New API Message"><group><group><field name="discussion"/></group></group><group><field name="body"/></group><group><group><field name="author"/><field name="display_name"/><field name="double_size"/><field name="author_partner"/><field name="label"/><field name="active"/></group><group><field name="name"/><field name="size"/><field name="discussion_name"/><field name="important"/><field name="priority"/><field name="attributes"/></group></group><group><separator/></group></sheet></form>'
  10. )
  11. self.assertEqual(
  12. etree.tostring(self.env['test_new_api.creativework.edition']._get_default_form_view()),
  13. b'<form><sheet string="Test New API Creative Work Edition"><group><group><field name="name"/><field name="res_model_id"/></group><group><field name="res_id"/><field name="res_model"/></group></group><group><separator/></group></sheet></form>'
  14. )
  15. self.assertEqual(
  16. etree.tostring(self.env['test_new_api.mixed']._get_default_form_view()),
  17. b'<form><sheet string="Test New API Mixed"><group><group><field name="number"/><field name="date"/><field name="now"/><field name="reference"/></group><group><field name="number2"/><field name="moment"/><field name="lang"/></group></group><group><field name="comment1"/></group><group><field name="comment2"/></group><group><field name="comment3"/></group><group><field name="comment4"/></group><group><field name="comment5"/></group><group><group><field name="currency_id"/></group><group><field name="amount"/></group></group><group><separator/></group></sheet></form>'
  18. )