Mercurial > moin > 2.0
annotate MoinMoin/converter/_tests/test_include.py @ 1018:dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
author  "Luis Henrique Fagundes <lhfagundes@gmail.com>" 

date  Sat, 29 Oct 2011 20:09:50 0200 
parents  d966ee4fba91 
children  afe0afe4e1a6 
rev  line source 

26
4cd8edde9e94
automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmannedv 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 waldmannedv 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 waldmannedv DOT de>
parents:
24
diff
changeset

3 
0
5568cf133caf
create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmannedv DOT de>
parents:
diff
changeset

4 """ 
5568cf133caf
create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmannedv 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 waldmannedv DOT de>
parents:
24
diff
changeset

6 """ 
0
5568cf133caf
create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmannedv DOT de>
parents:
diff
changeset

7 
5568cf133caf
create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmannedv 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 waldmannedv DOT de>
parents:
diff
changeset

10 
5568cf133caf
create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmannedv 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 waldmannedv 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 waldmannedv 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 waldmannedv 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 
d966ee4fba91
test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
644
diff
changeset

68 # we choosed MoinWiki items so tests get simpler 
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}}') 
d966ee4fba91
test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
644
diff
changeset

71 update_item(u'page3', {CONTENTTYPE: u'text/x.moin.wiki'}, u'{{page1}}') 
d966ee4fba91
test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
644
diff
changeset

72 
d966ee4fba91
test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
644
diff
changeset

73 page1 = MoinWiki.create(u'page1') 
d966ee4fba91
test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
644
diff
changeset

74 
d966ee4fba91
test for issue #80 (circular transclusion)
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
644
diff
changeset

75 page1._render_data() 
1018
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

76 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

77 def test_IncludeOfSingleLinePage(self): 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

78 # issue #28 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

79 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

80 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

81 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

82 rendered = MoinWiki.create(u'page1')._render_data() 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

83 assert 'Content of page2 is "Single line"' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

84 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

85 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

86 rendered = MoinWiki.create(u'page1')._render_data() 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

87 assert '<p>Two</p>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

88 assert '<p>Paragraphs</p>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

89 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

90 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

91 rendered = MoinWiki.create(u'page1')._render_data() 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

92 assert 'Content of page2 is "this text contains' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

93 assert '<em>italic</em>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

94 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

95 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

96 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

97 rendered = MoinWiki.create(u'page1')._render_data() 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

98 assert 'Content of page2 is</p>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

99 assert '<p>Single Line</p>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

100 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

101 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

102 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

103 rendered = MoinWiki.create(u'page1')._render_data() 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

104 assert 'Content of page2 is "</p>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

105 assert '<table>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

106 assert rendered.count('<table>') == 1 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

107 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

108 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

109 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 oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

110 rendered = MoinWiki.create(u'page1')._render_data() 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

111 assert 'Content of page2 is "</p>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

112 assert '<table>' in rendered 
dfbe65482a03
inserting {{MyWikiPage}} in middle of paragraph now makes valid html. inclusion of oneline page is shown inline. fixes #28
"Luis Henrique Fagundes <lhfagundes@gmail.com>"
parents:
1014
diff
changeset

113 assert rendered.count('<table>') == 1 