def setUp(self):
    super(StoryRightsSnapshotMetadataModelValidatorTests, 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)
    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:
        if (story.id != '0'):
            story_services.save_new_story(self.owner_id, story)
        else:
            story_services.save_new_story(self.user_id, story)
        topic.add_canonical_story(story.id)
    topic_services.save_new_topic(self.owner_id, topic)
    self.model_instance_0 = story_models.StoryRightsSnapshotMetadataModel.get_by_id('0-1')
    self.model_instance_1 = story_models.StoryRightsSnapshotMetadataModel.get_by_id('1-1')
    self.model_instance_2 = story_models.StoryRightsSnapshotMetadataModel.get_by_id('2-1')
    self.job_class = prod_validation_jobs_one_off.StoryRightsSnapshotMetadataModelAuditOneOffJob
def setUp(self):
    super(StoryRightsSnapshotMetadataModelValidatorTests, 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)
    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:
        if (story.id != '0'):
            story_services.save_new_story(self.owner_id, story)
        else:
            story_services.save_new_story(self.user_id, story)
        topic.add_canonical_story(story.id)
    topic_services.save_new_topic(self.owner_id, topic)
    self.model_instance_0 = story_models.StoryRightsSnapshotMetadataModel.get_by_id('0-1')
    self.model_instance_1 = story_models.StoryRightsSnapshotMetadataModel.get_by_id('1-1')
    self.model_instance_2 = story_models.StoryRightsSnapshotMetadataModel.get_by_id('2-1')
    self.job_class = prod_validation_jobs_one_off.StoryRightsSnapshotMetadataModelAuditOneOffJob