annotate MoinMoin/converter/_tests/test_include.py @ 1264:7275fd6533b2

fix internal server error on circular transclusion loop, enhance error message, fixes issue #80
author Roger Haase <crosseyedpenguin@yahoo.com>
date Tue, 14 Feb 2012 10:48:43 -0700
parents afe0afe4e1a6
children 4237934df124
rev   line source
26
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
1 # Copyright: 2008 MoinMoin:BastianBlank
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
2 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
3
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4 """
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 MoinMoin - Tests for MoinMoin.converter.include
26
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
6 """
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8
562
17931e46e2df py.test changed to pytest in conftest.py and all the tests of converter module.
pkumar <contactprashantat@gmail.com>
parents: 26
diff changeset
9 import pytest
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11 from MoinMoin.converter.include import *
1014
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
12 from MoinMoin.items import MoinWiki
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
13 from MoinMoin.config import CONTENTTYPE
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
14 from MoinMoin._tests import wikiconfig, update_item
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15
1014
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
16 class TestInclude(object):
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
17 class Config(wikiconfig.Config):
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
18 """
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
19 we just have this so the test framework creates a new app with empty backends for us.
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
20 """
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21
1014
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
22 def test_XPointer(self):
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
23 x = XPointer('a')
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
24 assert len(x) == 1
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
25 e = x[0]
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
26 assert e.name == 'a'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
27 assert e.data is None
644
beabd93b3904 removed extra whitespaces form codes, added my name to the tests I wrote
pkumar <contactprashantat@gmail.com>
parents: 624
diff changeset
28
1014
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
29 x = XPointer('a(b)')
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
30 assert len(x) == 1
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
31 e = x[0]
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
32 assert e.name == 'a'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
33 assert e.data == 'b'
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
34
1014
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
35 x = XPointer('a(^(b^)^^)')
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
36 assert len(x) == 1
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
37 e = x[0]
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
38 assert e.name == 'a'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
39 assert e.data == '^(b^)^^'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
40 assert e.data_unescape == '(b)^'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
41
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
42 x = XPointer('a(b)c(d)')
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
43 assert len(x) == 2
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
44 e = x[0]
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
45 assert e.name == 'a'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
46 assert e.data == 'b'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
47 e = x[1]
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
48 assert e.name == 'c'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
49 assert e.data == 'd'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
50
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
51 x = XPointer('a(b) c(d)')
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
52 assert len(x) == 2
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
53 e = x[0]
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
54 assert e.name == 'a'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
55 assert e.data == 'b'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
56 e = x[1]
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
57 assert e.name == 'c'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
58 assert e.data == 'd'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
59
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
60 x = XPointer('a(a(b))')
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
61 assert len(x) == 1
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
62 e = x[0]
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
63 assert e.name == 'a'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
64 assert e.data == 'a(b)'
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
65
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
66 def test_IncludeHandlesCircularRecursion(self):
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
67 # issue #80
1264
7275fd6533b2 fix internal server error on circular transclusion loop, enhance error message, fixes issue #80
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1019
diff changeset
68 # we use MoinWiki items to make tests simple
1014
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
69 update_item(u'page1', {CONTENTTYPE: u'text/x.moin.wiki'}, u'{{page2}}')
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
70 update_item(u'page2', {CONTENTTYPE: u'text/x.moin.wiki'}, u'{{page3}}')
1264
7275fd6533b2 fix internal server error on circular transclusion loop, enhance error message, fixes issue #80
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1019
diff changeset
71 update_item(u'page3', {CONTENTTYPE: u'text/x.moin.wiki'}, u'{{page4}}')
7275fd6533b2 fix internal server error on circular transclusion loop, enhance error message, fixes issue #80
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1019
diff changeset
72 update_item(u'page4', {CONTENTTYPE: u'text/x.moin.wiki'}, u'{{page2}}')
1014
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
73
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
74 page1 = MoinWiki.create(u'page1')
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
75
d966ee4fba91 test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 644
diff changeset
76 page1._render_data()
1018
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
77
1019
afe0afe4e1a6 recursive rename
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1018
diff changeset
78 def test_InlineInclude(self):
1018
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
79 # issue #28
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
80 update_item(u'page1', {CONTENTTYPE: u'text/x.moin.wiki'}, u'Content of page2 is "{{page2}}"')
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
81
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
82 update_item(u'page2', {CONTENTTYPE: u'text/x.moin.wiki'}, u'Single line')
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
83 rendered = MoinWiki.create(u'page1')._render_data()
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
84 assert 'Content of page2 is "Single line"' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
85
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
86 update_item(u'page2', {CONTENTTYPE: u'text/x.moin.wiki'}, u'Two\n\nParagraphs')
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
87 rendered = MoinWiki.create(u'page1')._render_data()
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
88 assert '<p>Two</p>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
89 assert '<p>Paragraphs</p>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
90
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
91 update_item(u'page2', {CONTENTTYPE: u'text/x.moin.wiki'}, u"this text contains ''italic'' string")
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
92 rendered = MoinWiki.create(u'page1')._render_data()
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
93 assert 'Content of page2 is "this text contains' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
94 assert '<em>italic</em>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
95
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
96 update_item(u'page1', {CONTENTTYPE: u'text/x.moin.wiki'}, u'Content of page2 is\n\n{{page2}}')
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
97 update_item(u'page2', {CONTENTTYPE: u'text/x.moin.wiki'}, u"Single Line")
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
98 rendered = MoinWiki.create(u'page1')._render_data()
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
99 assert 'Content of page2 is</p>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
100 assert '<p>Single Line</p>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
101
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
102 update_item(u'page1', {CONTENTTYPE: u'text/x.moin.wiki'}, u'Content of page2 is "{{page2}}"')
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
103 update_item(u'page2', {CONTENTTYPE: u'text/x.moin.wiki'}, u"|| table || cell ||")
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
104 rendered = MoinWiki.create(u'page1')._render_data()
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
105 assert 'Content of page2 is "</p>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
106 assert '<table>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
107 assert rendered.count('<table>') == 1
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
108
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
109 update_item(u'page1', {CONTENTTYPE: u'text/x.moin.wiki'}, u'Content of page2 is "{{page2}}"')
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
110 update_item(u'page2', {CONTENTTYPE: u'text/x.moin.wiki'}, u"|| this || has ||\n|| two || rows ||")
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
111 rendered = MoinWiki.create(u'page1')._render_data()
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
112 assert 'Content of page2 is "</p>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
113 assert '<table>' in rendered
dfbe65482a03 inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of one-line page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents: 1014
diff changeset
114 assert rendered.count('<table>') == 1