Test that the if_current_page tag works.
(self)
| 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()) |