def test_delete_exp_where_user_has_role_when_rights_model_marked_as_deleted(self):
    self.save_new_valid_collection(self.COL_2_ID, self.user_1_id)
    collection_services.delete_collection(self.user_1_id, self.COL_2_ID)
    collection_rights_model = collection_models.CollectionRightsModel.get_by_id(self.COL_2_ID)
    self.assertTrue(collection_rights_model.deleted)
    collection_model = collection_models.CollectionModel.get_by_id(self.COL_2_ID)
    self.assertTrue(collection_model.deleted)
    wipeout_service.pre_delete_user(self.user_1_id)
    self.process_and_flush_pending_tasks()
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    self.assertIsNone(collection_models.CollectionRightsModel.get_by_id(self.COL_2_ID))
    self.assertIsNone(collection_models.CollectionModel.get_by_id(self.COL_2_ID))
def test_delete_exp_where_user_has_role_when_rights_model_marked_as_deleted(self):
    self.save_new_valid_collection(self.COL_2_ID, self.user_1_id)
    collection_services.delete_collection(self.user_1_id, self.COL_2_ID)
    collection_rights_model = collection_models.CollectionRightsModel.get_by_id(self.COL_2_ID)
    self.assertTrue(collection_rights_model.deleted)
    collection_model = collection_models.CollectionModel.get_by_id(self.COL_2_ID)
    self.assertTrue(collection_model.deleted)
    wipeout_service.pre_delete_user(self.user_1_id)
    self.process_and_flush_pending_tasks()
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    self.assertIsNone(collection_models.CollectionRightsModel.get_by_id(self.COL_2_ID))
    self.assertIsNone(collection_models.CollectionModel.get_by_id(self.COL_2_ID))