def test_export_script_assemble_output(self): answer = Answer(id=1234) answer.save() page = AnswerPage(slug='mock-question1-en-1234', title='Mock question1') page.answer_base = answer page.question = 'Mock question1' helpers.publish_page(page) output = assemble_output()[0] self.assertEqual(output.get('ASK_ID'), 1234) self.assertEqual(output.get('URL'), '/mock-question1-en-1234/') self.assertEqual(output.get('Question'), 'Mock question1')
def test_export_script_assemble_output(self): answer = Answer(id=1234) answer.save() page = AnswerPage( slug='mock-question1-en-1234', title='Mock question1') page.answer_base = answer page.question = 'Mock question1' helpers.publish_page(page) output = assemble_output()[0] self.assertEqual(output.get('ASK_ID'), 1234) self.assertEqual(output.get('URL'), '/mock-question1-en-1234/') self.assertEqual(output.get('Question'), 'Mock question1')
def test_export_script_assemble_output(self): answer = Answer(id=1234) answer.save() page = AnswerPage(slug='mock-question1-en-1234', title='Mock question1') page.answer_base = answer page.question = 'Mock question1' page.answer_content = StreamValue(page.answer_content.stream_block, [{ 'type': 'text', 'value': 'Mock answer' }], True) helpers.publish_page(page) output = assemble_output()[0] self.assertEqual(output.get('ASK_ID'), 1234) self.assertEqual(output.get('URL'), '/mock-question1-en-1234/') self.assertEqual(output.get('Question'), 'Mock question1')
def test_export_script_assemble_output(self): answer = Answer(id=1234) answer.save() page = AnswerPage( slug="mock-question1-en-1234", title="Mock question1" ) page.answer_base = answer page.question = "Mock question1" page.answer_content = StreamValue( page.answer_content.stream_block, [{"type": "text", "value": {"content": "Mock answer"}}], True, ) helpers.publish_page(page) output = assemble_output()[0] self.assertEqual(output.get("ASK_ID"), 1234) self.assertEqual(output.get("URL"), "/mock-question1-en-1234/") self.assertEqual(output.get("Question"), "Mock question1")
def test_export_script_assemble_output(self): answer = Answer(id=1234) answer.save() page = AnswerPage( slug='mock-question1-en-1234', title='Mock question1') page.answer_base = answer page.question = 'Mock question1' page.answer_content = StreamValue( page.answer_content.stream_block, [{ 'type': 'text', 'value': 'Mock answer' }], True ) helpers.publish_page(page) output = assemble_output()[0] self.assertEqual(output.get('ASK_ID'), 1234) self.assertEqual(output.get('URL'), '/mock-question1-en-1234/') self.assertEqual(output.get('Question'), 'Mock question1')