'Verify that deprecated blocks list shown on banner is updated correctly.
Here is the scenario:
This list of deprecated blocks shown on banner contains published
and un-published blocks. That list should be updated when we delete
un-published block(s). This behavior should be same if we delete
unpublished vertical or problem.'

@ddt.data({'delete_vertical': True}, {'delete_vertical': False})
@ddt.unpack
def test_deprecated_blocks_list_updated_correctly(self, delete_vertical):

    block_types = ['notes']
    course_module = modulestore().get_item(self.course.location)
    vertical1 = ItemFactory.create(parent_location=self.sequential.location, category='vertical', display_name='Vert1    Subsection1')
    problem1 = ItemFactory.create(parent_location=vertical1.location, category='notes', display_name='notes    problem    in    vert1', publish_item=False)
    info = _deprecated_blocks_info(course_module, block_types)
    self.assertEqual(info['blocks'], [])
    vertical2 = ItemFactory.create(parent_location=self.sequential.location, category='vertical', display_name='Vert2    Subsection1')
    ItemFactory.create(parent_location=vertical2.location, category='notes', display_name='notes    problem    in    vert2', pubish_item=True)
    info = _deprecated_blocks_info(course_module, block_types)
    self.assertItemsEqual(info['blocks'], [[reverse_usage_url('container_handler', vertical1.location), 'notes    problem    in    vert1'], [reverse_usage_url('container_handler', vertical2.location), 'notes    problem    in    vert2']])
    if delete_vertical:
        self.store.delete_item(vertical1.location, self.user.id)
    else:
        self.store.delete_item(problem1.location, self.user.id)
    info = _deprecated_blocks_info(course_module, block_types)
    self.assertEqual(info['blocks'], [[reverse_usage_url('container_handler', vertical2.location), 'notes    problem    in    vert2']])
