def testInlineInvalidationsMigration(self):
    """Ensure that the INLINE_INVALIDATIONS migration works correctly."""
    episode_id = Episode.ConstructEpisodeId(1, self._device_ids[0], 1)
    photo_id = Photo.ConstructPhotoId(1, self._device_ids[0], 1)
    request = {'activity': self._tester.CreateActivityDict(self._cookie),
               'episode': {'episode_id': episode_id,
                           'timestamp': 1},
               'photos': [self._CreatePhotoDict(self._cookie, photo_id=photo_id)]}
    self._SendRequest('upload_episode', self._cookie, request,
                      version=Message.EXTRACT_MD5_HASHES)

    request = {'episodes': [{'episode_id': episode_id,
                             'photo_ids': [photo_id]}]}
    self._SendRequest('remove_photos', self._cookie, request,
                      version=Message.EXTRACT_MD5_HASHES)

    request = {'activity': self._tester.CreateActivityDict(self._cookie),
               'viewpoint_id': self._user.private_vp_id,
               'viewed_seq': 2}
    self._SendRequest('update_viewpoint', self._cookie, request,
                      version=Message.EXTRACT_MD5_HASHES)

    response = self._SendRequest('query_notifications', self._cookie, {},
                                 version=Message.EXTRACT_MD5_HASHES)

    # upload_episode notification.
    notify_dict = response['notifications'][1]
    self.assertFalse('inline' in notify_dict)
    self.assertTrue('activity' in notify_dict)
    self.assertEqual(notify_dict['activity']['update_seq'], 1)

    # remove_photos notification.
    notify_dict = response['notifications'][2]
    self.assertFalse('inline' in notify_dict)
    self.assertFalse('activity' in notify_dict)

    # update_viewpoint notification.
    notify_dict = response['notifications'][3]
    self.assertFalse('inline' in notify_dict)
    self.assertFalse('activity' in notify_dict)
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/test/versioning_test.py/VersioningTestCase.testInlineInvalidationsMigration/original