From 8195677cae913e2f964bf631d88f00a33e16bc24 Mon Sep 17 00:00:00 2001 From: Sunaina Pai Date: Sat, 11 Aug 2018 14:40:18 +0530 Subject: 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. --- test/test_truncate.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/test_truncate.py (limited to 'test/test_truncate.py') diff --git a/test/test_truncate.py b/test/test_truncate.py new file mode 100644 index 0000000..3486d71 --- /dev/null +++ b/test/test_truncate.py @@ -0,0 +1,9 @@ +import unittest +import makesite + + +class TruncateTest(unittest.TestCase): + def test_truncate(self): + long_text = ' \n'.join('word' + str(i) for i in range(50)) + expected_text = ' '.join('word' + str(i) for i in range(25)) + self.assertEqual(makesite.truncate(long_text), expected_text) -- cgit v1.2.3