"""Page « Publier » : Markdown sûr, tableaux, brouillons privés, publication (vrai HTTP local, SQLite jetable)."""
import json
import re
import unittest
from urllib.parse import urlencode
import test_forum as base
import markdown_sur
from forum import Invalide
class TestMarkdown(unittest.TestCase):
def test_html_echappe_et_liens_surs(self):
h = markdown_sur.rendu("\n")
self.assertNotIn(" [x](javascript:alert(1))"
st, h, _ = self.post("/publier", "a1", {"brouillon": bid, "titre": "Gel matinal", "corps": corps,
"station": "geve", "prevenir": "1", "action": "publier"})
self.assertEqual(st, 303)
tid = int(re.search(r"/t/(\d+)", h["Location"]).group(1))
page = self.req(h["Location"])[2].decode()
self.assertIn("