def setUp(self):
    super(CollectionRightsSnapshotMetadataModelValidatorTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.signup(USER_EMAIL, USER_NAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_EMAIL)
    self.user_id = self.get_user_id_from_email(USER_EMAIL)
    explorations = [exp_domain.Exploration.create_default_exploration(('%s' % i), title=('title %d' % i), category=('category%d' % i)) for i in xrange(6)]
    for exp in explorations:
        exp_services.save_new_exploration(self.owner_id, exp)
    collections = [collection_domain.Collection.create_default_collection(('%s' % i), title=('title %d' % i), category=('category%d' % i), objective=('objective%d' % i)) for i in xrange(3)]
    for (index, collection) in enumerate(collections):
        collection.add_node(('%s' % (index * 2)))
        collection.add_node(('%s' % ((index * 2) + 1)))
        if (collection.id != '0'):
            collection_services.save_new_collection(self.owner_id, collection)
        else:
            collection_services.save_new_collection(self.user_id, collection)
    self.model_instance_0 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id('0-1')
    self.model_instance_1 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id('1-1')
    self.model_instance_2 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id('2-1')
    self.job_class = prod_validation_jobs_one_off.CollectionRightsSnapshotMetadataModelAuditOneOffJob
def setUp(self):
    super(CollectionRightsSnapshotMetadataModelValidatorTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.signup(USER_EMAIL, USER_NAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_EMAIL)
    self.user_id = self.get_user_id_from_email(USER_EMAIL)
    explorations = [exp_domain.Exploration.create_default_exploration(('%s' % i), title=('title %d' % i), category=('category%d' % i)) for i in xrange(6)]
    for exp in explorations:
        exp_services.save_new_exploration(self.owner_id, exp)
    collections = [collection_domain.Collection.create_default_collection(('%s' % i), title=('title %d' % i), category=('category%d' % i), objective=('objective%d' % i)) for i in xrange(3)]
    for (index, collection) in enumerate(collections):
        collection.add_node(('%s' % (index * 2)))
        collection.add_node(('%s' % ((index * 2) + 1)))
        if (collection.id != '0'):
            collection_services.save_new_collection(self.owner_id, collection)
        else:
            collection_services.save_new_collection(self.user_id, collection)
    self.model_instance_0 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id('0-1')
    self.model_instance_1 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id('1-1')
    self.model_instance_2 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id('2-1')
    self.job_class = prod_validation_jobs_one_off.CollectionRightsSnapshotMetadataModelAuditOneOffJob