summaryrefslogtreecommitdiff
path: root/test/test_content.py
diff options
context:
space:
mode:
authorSunaina Pai <sunainapai.in@gmail.com>2018-08-11 14:40:18 +0530
committerSunaina Pai <sunainapai.in@gmail.com>2018-08-11 14:40:18 +0530
commit8195677cae913e2f964bf631d88f00a33e16bc24 (patch)
tree3dddc9320f46c48e7b5e43bbbe4fb765b75b4e9b /test/test_content.py
parent020ab349067939a121f8b75f003501a7e00198c6 (diff)
Populate placeholders in content when specified
Placeholders in content files are not populated by default. If placeholders are to be populated in content files, parameter named `render` with a string value of `yes` must be specified. This `render` parameter may be specified as a header in content files or it may be specified as a keyword argument in `make_pages` call.
Diffstat (limited to 'test/test_content.py')
-rw-r--r--test/test_content.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/test/test_content.py b/test/test_content.py
index 06ec97d..66342d9 100644
--- a/test/test_content.py
+++ b/test/test_content.py
@@ -11,7 +11,6 @@ class ContentTest(unittest.TestCase):
self.blog_path = path.temppath('blog')
self.undated_path = os.path.join(self.blog_path, 'foo.txt')
self.dated_path = os.path.join(self.blog_path, '2018-01-01-foo.txt')
- self.long_post_path = os.path.join(self.blog_path, 'bar.txt')
self.normal_post_path = os.path.join(self.blog_path, 'baz.txt')
self.md_post_path = os.path.join(self.blog_path, 'qux.md')
self.no_md_post_path = os.path.join(self.blog_path, 'qux.txt')
@@ -24,10 +23,6 @@ class ContentTest(unittest.TestCase):
with open(self.dated_path, 'w') as f:
f.write('hello world')
- with open(self.long_post_path, 'w') as f:
- self.long_text = ' \n'.join('word' + str(i) for i in range(50))
- f.write(self.long_text)
-
with open(self.normal_post_path, 'w') as f:
f.write('<!-- a: 1 -->\n<!-- b: 2 -->\nFoo')
@@ -45,13 +40,8 @@ class ContentTest(unittest.TestCase):
self.mock_args = args
def test_content_content(self):
- content = makesite.read_content(self.long_post_path)
- self.assertEqual(content['content'], self.long_text)
-
- def test_content_summary(self):
- content = makesite.read_content(self.long_post_path)
- expected_text = ' '.join('word' + str(i) for i in range(25))
- self.assertEqual(content['summary'], expected_text)
+ content = makesite.read_content(self.undated_path)
+ self.assertEqual(content['content'], 'hello world')
def test_content_date(self):
content = makesite.read_content(self.dated_path)