コード例 #1
0
 def test_04_get_fields(self):
     """
     Test that get_fields returns the fields parameter of the OdooClass object
     :return:
     """
     test_oc = OdooClass('name')
     test_oc.fields = ['field']
     self.assertListEqual(['field'], test_oc.get_fields())
コード例 #2
0
 def test_06_add_field(self):
     """
     Test that OdooField objects are added correctly using add_field method
     :return:
     """
     test_oc = OdooClass('name')
     test_oc.add_field('field', 'type')
     fields = test_oc.get_fields()
     self.assertEqual(len(fields), 1)
     self.assertIsInstance(fields[0], OdooField)