MCPcopy
hub / github.com/eudicots/Cactus / test_current_page

Method test_current_page

cactus/tests/test_basic.py:95–116  ·  view source on GitHub ↗

Test that the if_current_page tag works.

(self)

Source from the content-addressed store, hash-verified

93 self.assertEqual(self.site.get_url_for_static(static), obtained.read())
94
95 def test_current_page(self):
96 """
97 Test that the if_current_page tag works.
98 """
99 page = 'page1.html'
100 content = "{%% if_current_page '/%s' %%}" % page
101
102 other = 'page2.html'
103
104 with open(os.path.join(self.path, 'pages', page), 'w') as f:
105 f.write(content)
106
107 with open(os.path.join(self.path, 'pages', other), 'w') as f:
108 f.write(content)
109
110 self.site.build()
111
112 with open(os.path.join(self.path, '.build', page), 'rU') as f:
113 self.assertEqual('True', f.read())
114
115 with open(os.path.join(self.path, '.build', other), 'rU') as f:
116 self.assertEqual('False', f.read())

Callers

nothing calls this directly

Calls 3

readMethod · 0.80
writeMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected