'Test the "removed" event emitted when we un-assign blocks previously assigned to a student.
We go from one blocks assigned to none because max_count has been decreased.'

def test_removed_overlimit(self):

    self.lc_block.get_child_descriptors()
    self.publisher.reset_mock()
    self.lc_block.max_count = 0
    del self.lc_block._xmodule._selected_set
    children = self.lc_block.get_child_descriptors()
    self.assertEqual(len(children), 0)
    event_data = self._assert_event_was_published('removed')
    self.assertEqual(len(event_data['removed']), 1)
    self.assertEqual(event_data['result'], [])
    self.assertEqual(event_data['reason'], 'overlimit')
