'Check that a LibraryContentModule analytics event was published by self.lc_block.'

def _assert_event_was_published(self, event_type):

    self.assertTrue(self.publisher.called)
    self.assertTrue(len(self.publisher.call_args[0]), 3)
    (_, event_name, event_data) = self.publisher.call_args[0]
    self.assertEqual(event_name, 'edx.librarycontentblock.content.{}'.format(event_type))
    self.assertEqual(event_data['location'], unicode(self.lc_block.location))
    return event_data
