示例#1
0
 def tests_api_asset_part(self):
     for item in get_asset_parts():
         self.assertEqual(item['price'], 100)
         # self.assertEqual(item['is_deprecated'], False)
         model = self.model
         self.assertEqual(item['model'], model.name)
         self.assertEqual(item['asset_id'], self.asset2.id)
         self.assertEqual(item['sn'], self.asset.sn)
         self.assertEqual(item['barcode'], self.asset.barcode)
示例#2
0
 def tests_api_asset_part(self):
     for item in get_asset_parts():
         self.assertEqual(item['price'], 100)
         # self.assertEqual(item['is_deprecated'], False)
         model = self.model
         self.assertEqual(item['model'], model.name)
         self.assertEqual(item['asset_id'], self.asset2.id)
         self.assertEqual(item['sn'], self.asset.sn)
         self.assertEqual(item['barcode'], self.asset.barcode)
示例#3
0
def assets_parts(**kwargs):
    """Updates the devices from Ralph Assets."""
    date = kwargs['today']
    count = sum(update_assets_parts(data, date) for data in get_asset_parts())
    return True, '%d new devices' % count, kwargs
示例#4
0
def assets_parts(**kwargs):
    """Updates the devices from Ralph Assets."""
    date = kwargs['today']
    count = sum(update_assets_parts(data, date) for data in get_asset_parts())
    return True, '%d new devices' % count, kwargs