def setUp(self):
    super(StoryModelValidatorTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_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)
    topic = topic_domain.Topic.create_default_topic(topic_id='0', name='topic')
    language_codes = ['ar', 'en', 'en']
    stories = [story_domain.Story.create_default_story(('%s' % i), title='title %d', corresponding_topic_id='0') for i in xrange(3)]
    for (index, story) in enumerate(stories):
        story.language_code = language_codes[index]
        story.add_node('node_1', 'Node1')
        story.add_node('node_2', 'Node2')
        story.update_node_destination_node_ids('node_1', ['node_2'])
        story.update_node_exploration_id('node_1', explorations[(index * 2)].id)
        story.update_node_exploration_id('node_2', explorations[((index * 2) + 1)].id)
        topic.add_canonical_story(story.id)
        story_services.save_new_story(self.owner_id, story)
    topic_services.save_new_topic(self.owner_id, topic)
    self.model_instance_0 = story_models.StoryModel.get_by_id('0')
    self.model_instance_1 = story_models.StoryModel.get_by_id('1')
    self.model_instance_2 = story_models.StoryModel.get_by_id('2')
    self.job_class = prod_validation_jobs_one_off.StoryModelAuditOneOffJob
def setUp(self):
    super(StoryModelValidatorTests, self).setUp()
    self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
    self.owner_id = self.get_user_id_from_email(self.OWNER_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)
    topic = topic_domain.Topic.create_default_topic(topic_id='0', name='topic')
    language_codes = ['ar', 'en', 'en']
    stories = [story_domain.Story.create_default_story(('%s' % i), title='title %d', corresponding_topic_id='0') for i in xrange(3)]
    for (index, story) in enumerate(stories):
        story.language_code = language_codes[index]
        story.add_node('node_1', 'Node1')
        story.add_node('node_2', 'Node2')
        story.update_node_destination_node_ids('node_1', ['node_2'])
        story.update_node_exploration_id('node_1', explorations[(index * 2)].id)
        story.update_node_exploration_id('node_2', explorations[((index * 2) + 1)].id)
        topic.add_canonical_story(story.id)
        story_services.save_new_story(self.owner_id, story)
    topic_services.save_new_topic(self.owner_id, topic)
    self.model_instance_0 = story_models.StoryModel.get_by_id('0')
    self.model_instance_1 = story_models.StoryModel.get_by_id('1')
    self.model_instance_2 = story_models.StoryModel.get_by_id('2')
    self.job_class = prod_validation_jobs_one_off.StoryModelAuditOneOffJob