def setUp(self):
    super(StorySummaryModelValidatorTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_EMAIL)
    language_codes = ['ar', 'en', 'en']
    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 (index, story) in enumerate(stories):
        story.description = 'story-test'
        story.language_code = language_codes[index]
        story_services.save_new_story(self.owner_id, story)
        topic.add_canonical_story(story.id)
    topic_services.save_new_topic(self.owner_id, topic)
    self.model_instance_0 = story_models.StorySummaryModel.get_by_id('0')
    self.model_instance_1 = story_models.StorySummaryModel.get_by_id('1')
    self.model_instance_2 = story_models.StorySummaryModel.get_by_id('2')
    self.job_class = prod_validation_jobs_one_off.StorySummaryModelAuditOneOffJob
def setUp(self):
    super(StorySummaryModelValidatorTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_EMAIL)
    language_codes = ['ar', 'en', 'en']
    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 (index, story) in enumerate(stories):
        story.description = 'story-test'
        story.language_code = language_codes[index]
        story_services.save_new_story(self.owner_id, story)
        topic.add_canonical_story(story.id)
    topic_services.save_new_topic(self.owner_id, topic)
    self.model_instance_0 = story_models.StorySummaryModel.get_by_id('0')
    self.model_instance_1 = story_models.StorySummaryModel.get_by_id('1')
    self.model_instance_2 = story_models.StorySummaryModel.get_by_id('2')
    self.job_class = prod_validation_jobs_one_off.StorySummaryModelAuditOneOffJob