You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1014 B

  1. # -*- coding: utf-8 -*-
  2. # © 2015 Antiun Ingeniería S.L. - Jairo Llopis
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from openerp.tests.common import TransactionCase
  5. class TestIrExportsCase(TransactionCase):
  6. def test_create_with_basic_data(self):
  7. """Emulate creation from original form.
  8. This form is handled entirely client-side, and lacks some required
  9. field values.
  10. """
  11. # Emulate creation from JsonRpc, without model_id and field#_id
  12. data = {
  13. "name": u"Test éxport",
  14. "resource": "ir.exports",
  15. "export_fields": [
  16. [0, 0, {"name": "export_fields"}],
  17. [0, 0, {"name": "export_fields/create_uid"}],
  18. [0, 0, {"name": "export_fields/create_date"}],
  19. [0, 0, {"name": "export_fields/field1_id"}],
  20. ],
  21. }
  22. record = self.env["ir.exports"].create(data)
  23. self.assertEqual(record.model_id.model, data["resource"])