def loads(self, requirements_text):
        lines = re.findall(Requirement.spec_regex,
                           requirements_text,
                           re.MULTILINE)
        for line in lines:
            self.add(Requirement(line[0], "".join(line[1:])))
def test_accept_suggestion_adds_translation_in_exploration(self):
        self.save_new_default_exploration('exp1', self.author_id)
        exploration = exp_fetchers.get_exploration_by_id('exp1')
        self.assertEqual(exploration.get_translation_counts(), {})
        suggestion = suggestion_registry.SuggestionTranslateContent(
            self.suggestion_dict['suggestion_id'],
            self.suggestion_dict['target_id'],
            self.suggestion_dict['target_version_at_submission'],
            self.suggestion_dict['status'], self.author_id,
            self.reviewer_id, self.suggestion_dict['change'],
            self.suggestion_dict['score_category'],
            self.suggestion_dict['language_code'], False, self.fake_date)

        suggestion.accept(
            'Accepted suggestion by translator: Add translation change.')

        exploration = exp_fetchers.get_exploration_by_id('exp1')
        self.assertEqual(exploration.get_translation_counts(), {
            'hi': 1
        })