コード例 #1
0
 def test_03_get_name(self):
     """
     Test that get_name returns the name parameter of the OdooClass object
     :return:
     """
     test_oc = OdooClass('name')
     self.assertEqual('name', test_oc.get_name())
コード例 #2
0
 def test_05_get_relations(self):
     """
     Test that get_relations returns the relations parameter of the OdooClass object
     :return:
     """
     test_oc = OdooClass('name')
     test_oc.relations = ['relation']
     self.assertListEqual(['relation'], test_oc.get_relations())
コード例 #3
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())
コード例 #4
0
 def test_07_add_relation(self):
     """
     Test that OdooRelation objects are added correctly using add_relation method
     :return:
     """
     test_oc = OdooClass('name')
     test_oc.add_relation('name', 'type', 'model')
     relations = test_oc.get_relations()
     self.assertEqual(len(relations), 1)
     self.assertIsInstance(relations[0], OdooRelation)
コード例 #5
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)