def setUp(self):
    super(StoryRightsModelValidatorTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.signup(self.ADMIN_EMAIL, self.ADMIN_USERNAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_EMAIL)
    self.admin_id = self.get_user_id_from_email(self.ADMIN_EMAIL)
    self.set_admins([self.ADMIN_USERNAME])
    self.admin = user_services.UserActionsInfo(self.admin_id)
    manager1_email = 'example@example.com'
    manager2_email = 'example@example.com'
    self.signup(manager1_email, 'manager1')
    self.signup(manager2_email, 'manager2')
    self.set_topic_managers(['manager1', 'manager2'])
    self.manager1_id = self.get_user_id_from_email(manager1_email)
    self.manager2_id = self.get_user_id_from_email(manager2_email)
    self.manager1 = user_services.UserActionsInfo(self.manager1_id)
    self.manager2 = user_services.UserActionsInfo(self.manager2_id)
    topic = topic_domain.Topic.create_default_topic(topic_id='0', name='topic')
    stories = [story_domain.Story.create_default_story(('%s' % i), title=('title %d' % i), corresponding_topic_id='0') for i in xrange(3)]
    for story in stories:
        story_services.save_new_story(self.owner_id, story)
        topic.add_canonical_story(story.id)
    topic_services.save_new_topic(self.owner_id, topic)
    story_services.assign_role(self.admin, self.manager1, story_domain.ROLE_MANAGER, stories[0].id)
    story_services.assign_role(self.admin, self.manager2, story_domain.ROLE_MANAGER, stories[0].id)
    story_services.assign_role(self.admin, self.manager2, story_domain.ROLE_MANAGER, stories[1].id)
    self.model_instance_0 = story_models.StoryRightsModel.get_by_id('0')
    self.model_instance_1 = story_models.StoryRightsModel.get_by_id('1')
    self.model_instance_2 = story_models.StoryRightsModel.get_by_id('2')
    self.job_class = prod_validation_jobs_one_off.StoryRightsModelAuditOneOffJob
def setUp(self):
    super(StoryRightsModelValidatorTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.signup(self.ADMIN_EMAIL, self.ADMIN_USERNAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_EMAIL)
    self.admin_id = self.get_user_id_from_email(self.ADMIN_EMAIL)
    self.set_admins([self.ADMIN_USERNAME])
    self.admin = user_services.UserActionsInfo(self.admin_id)
    manager1_email = 'example@example.com'
    manager2_email = 'example@example.com'
    self.signup(manager1_email, 'manager1')
    self.signup(manager2_email, 'manager2')
    self.set_topic_managers(['manager1', 'manager2'])
    self.manager1_id = self.get_user_id_from_email(manager1_email)
    self.manager2_id = self.get_user_id_from_email(manager2_email)
    self.manager1 = user_services.UserActionsInfo(self.manager1_id)
    self.manager2 = user_services.UserActionsInfo(self.manager2_id)
    topic = topic_domain.Topic.create_default_topic(topic_id='0', name='topic')
    stories = [story_domain.Story.create_default_story(('%s' % i), title=('title %d' % i), corresponding_topic_id='0') for i in xrange(3)]
    for story in stories:
        story_services.save_new_story(self.owner_id, story)
        topic.add_canonical_story(story.id)
    topic_services.save_new_topic(self.owner_id, topic)
    story_services.assign_role(self.admin, self.manager1, story_domain.ROLE_MANAGER, stories[0].id)
    story_services.assign_role(self.admin, self.manager2, story_domain.ROLE_MANAGER, stories[0].id)
    story_services.assign_role(self.admin, self.manager2, story_domain.ROLE_MANAGER, stories[1].id)
    self.model_instance_0 = story_models.StoryRightsModel.get_by_id('0')
    self.model_instance_1 = story_models.StoryRightsModel.get_by_id('1')
    self.model_instance_2 = story_models.StoryRightsModel.get_by_id('2')
    self.job_class = prod_validation_jobs_one_off.StoryRightsModelAuditOneOffJob