Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #19 from wmatyskiewicz/master

Asset API fix
  • Loading branch information...
commit b032fe1324c4f69060b696e43062c8840d31bd85 2 parents d32372f + 8b1a2fc
@deshipu deshipu authored
View
3  src/ralph_assets/api_pricing.py
@@ -29,7 +29,8 @@ def get_asset_parts():
for part in asset.get_parts():
device_info = asset.device_info
yield {
- 'asset_id': asset.id,
+ 'asset_id': part.id,
+ 'asset_parent_id':asset.id,
'barcode': asset.barcode,
'is_deprecated': part.is_deprecated(),
'model': part.model.name if part.model else None,
View
3  src/ralph_assets/tests/unit/tests_models.py
@@ -109,6 +109,7 @@ def tests_api_asset_part(self):
self.assertEqual(item['is_deprecated'], True)
model = AssetModel.objects.get(name="Model1")
self.assertEqual(item['model'], model.name)
- self.assertEqual(item['asset_id'], self.asset.id)
+ self.assertEqual(item['asset_id'], self.asset2.id)
+ self.assertEqual(item['asset_parent_id'], self.asset.id)
self.assertEqual(item['sn'], self.asset.sn)
self.assertEqual(item['barcode'], self.asset.barcode)
Please sign in to comment.
Something went wrong with that request. Please try again.