Ejemplo n.º 1
0
 def test_get_list(self):
     """ Test retrieving a list of eotps
     """
     for data in test_data:
         result = Eotp.get_list(filters=data.items(), pattern=data["pattern"])
         self.assertIsInstance(result, type([]))
         for eotp, codes in zip(result, data["expected"]):
             self.assertIsInstance(eotp, Eotp)
             self.assertEqual(eotp.code, codes[0])
             if len(codes) == 2:
                 self.assertEqual(eotp.cost_center.code, codes[1])
             else:
                 self.assertIsNone(eotp.cost_center)