'Video events should all contain "id" and "code" attributes in their payload.
This function asserts that those fields are present and have correct values.'

def assert_payload_contains_ids(self, video_event):

    video_descriptors = self.course_fixture.get_nested_xblocks(category='video')
    video_desc = video_descriptors[0]
    video_locator = UsageKey.from_string(video_desc.locator)
    expected_event = {'event': {'id': video_locator.html_id(), 'code': '3_yD_cEKoCk'}}
    self.assert_events_match([expected_event], [video_event])
