mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 22:23:23 +00:00
Fix tests and force Markdown renderer to escape HTML
This commit is contained in:
parent
daee59f772
commit
11e05050f7
@ -121,7 +121,7 @@ class SithInlineLexer(InlineLexer):
|
|||||||
except: pass
|
except: pass
|
||||||
return super(SithInlineLexer, self)._process_link(m, link, title)
|
return super(SithInlineLexer, self)._process_link(m, link, title)
|
||||||
|
|
||||||
renderer = SithRenderer()
|
renderer = SithRenderer(escape=True)
|
||||||
inline = SithInlineLexer(renderer)
|
inline = SithInlineLexer(renderer)
|
||||||
|
|
||||||
markdown = Markdown(renderer, inline=inline)
|
markdown = Markdown(renderer, inline=inline)
|
||||||
|
@ -253,8 +253,8 @@ http://git.an
|
|||||||
response = self.client.get(reverse('core:page', kwargs={'page_name': 'guy'}))
|
response = self.client.get(reverse('core:page', kwargs={'page_name': 'guy'}))
|
||||||
self.assertTrue(response.status_code == 200)
|
self.assertTrue(response.status_code == 200)
|
||||||
self.assertTrue('<p>Guy <em>bibou</em></p>\\n<p><a href="http://git.an">http://git.an</a></p>\\n' +
|
self.assertTrue('<p>Guy <em>bibou</em></p>\\n<p><a href="http://git.an">http://git.an</a></p>\\n' +
|
||||||
'<h1>Swag</h1>\\n<p><guy>Bibou</guy></p>\\n' +
|
'<h1>Swag</h1>\\n<guy>Bibou</guy>' +
|
||||||
'<p><script>alert('Guy');</script></p>' in str(response.content))
|
"<script>alert(\\'Guy\\');</script>" in str(response.content))
|
||||||
|
|
||||||
#TODO: many tests on the pages:
|
#TODO: many tests on the pages:
|
||||||
# - renaming a page
|
# - renaming a page
|
||||||
|
Loading…
Reference in New Issue
Block a user