def setUp(self):
    super(OneOffReindexActivitiesJobTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_EMAIL)
    self.owner = user_services.UserActionsInfo(self.owner_id)
    explorations = [exp_domain.Exploration.create_default_exploration(('%s' % i), title=('title %d' % i), category=('category%d' % i)) for i in python_utils.RANGE(3)]
    for exp in explorations:
        exp_services.save_new_exploration(self.owner_id, exp)
        rights_manager.publish_exploration(self.owner, exp.id)
    collections = [collection_domain.Collection.create_default_collection(('%s' % i), title=('title %d' % i), category=('category%d' % i)) for i in python_utils.RANGE(3, 6)]
    for collection in collections:
        collection_services.save_new_collection(self.owner_id, collection)
        rights_manager.publish_collection(self.owner, collection.id)
    self.process_and_flush_pending_mapreduce_tasks()
def setUp(self):
    super(OneOffReindexActivitiesJobTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_EMAIL)
    self.owner = user_services.UserActionsInfo(self.owner_id)
    explorations = [exp_domain.Exploration.create_default_exploration(('%s' % i), title=('title %d' % i), category=('category%d' % i)) for i in python_utils.RANGE(3)]
    for exp in explorations:
        exp_services.save_new_exploration(self.owner_id, exp)
        rights_manager.publish_exploration(self.owner, exp.id)
    collections = [collection_domain.Collection.create_default_collection(('%s' % i), title=('title %d' % i), category=('category%d' % i)) for i in python_utils.RANGE(3, 6)]
    for collection in collections:
        collection_services.save_new_collection(self.owner_id, collection)
        rights_manager.publish_collection(self.owner, collection.id)
    self.process_and_flush_pending_mapreduce_tasks()