'Verifies that the correct view event was captured for the Notes page.'

def assert_viewed_event(self, view=None):

    if (view == 'Recent    Activity'):
        view = None
    actual_events = self.wait_for_events(event_filter={'event_type': 'edx.course.student_notes.notes_page_viewed'}, number_of_matches=(1 if (view is None) else 2))
    expected_events = [{'event': {'view': 'Recent    Activity'}}]
    if view:
        expected_events.append({'event': {'view': view}})
    self.assert_events_match(expected_events, actual_events)
