Fix inventory source name to exclude replacement text, fix inventory update name to be based only on inventory and group name. Fixes https://trello.com/c/zYrHMz9S

This commit is contained in:
Chris Church
2015-06-02 19:46:18 -04:00
parent bcf4688a55
commit 77ab83eb0d
2 changed files with 18 additions and 4 deletions
+6
View File
@@ -1778,6 +1778,12 @@ class InventoryUpdatesTest(BaseTransactionTest):
child_names = self.group.children.filter(active=True).values_list('name', flat=True)
self.assertTrue(region_group_original_name in self.group.children.get(name='regions').children.values_list('name', flat=True))
self.assertTrue(region_group.name in self.group.children.get(name='regions').children.values_list('name', flat=True))
# Replacement text should not be left in inventory source name.
self.assertFalse(InventorySource.objects.filter(name__icontains='__replace_').exists())
# Inventory update name should be based on inventory/group names and need not have the inventory source pk.
print InventoryUpdate.objects.values_list('name', 'inventory_source__name')
for inventory_update in InventoryUpdate.objects.all():
self.assertFalse(inventory_update.name.endswith(inventory_update.inventory_source.name), inventory_update.name)
return
# Print out group/host tree for debugging.
print