'Assert move component.
Arguments:
source_usage_key (BlockUsageLocator): Locator of source item.
target_usage_key (BlockUsageLocator): Locator of target parent.
target_index (int): If provided, insert source item at the provided index location in target_usage_key item.'

def assert_move_item(self, source_usage_key, target_usage_key, target_index=None):

    parent_loc = self.store.get_parent_location(source_usage_key)
    parent = self.get_item_from_modulestore(parent_loc)
    source_index = _get_source_index(source_usage_key, parent)
    expected_index = (target_index if (target_index is not None) else source_index)
    response = self._move_component(source_usage_key, target_usage_key, target_index)
    self.assertEqual(response.status_code, 200)
    response = json.loads(response.content)
    self.assertEqual(response['move_source_locator'], unicode(source_usage_key))
    self.assertEqual(response['parent_locator'], unicode(target_usage_key))
    self.assertEqual(response['source_index'], expected_index)
    new_parent_loc = self.store.get_parent_location(source_usage_key)
    source_item = self.get_item_from_modulestore(source_usage_key)
    self.assertEqual(source_item.parent, new_parent_loc)
    self.assertEqual(new_parent_loc, target_usage_key)
    self.assertNotEqual(parent_loc, new_parent_loc)
    target_parent = self.get_item_from_modulestore(target_usage_key)
    source_parent = self.get_item_from_modulestore(parent_loc)
    self.assertIn(source_usage_key, target_parent.children)
    self.assertNotIn(source_usage_key, source_parent.children)
