| Index: tests/test_parse_page_content.py |
| =================================================================== |
| new file mode 100644 |
| --- /dev/null |
| +++ b/tests/test_parse_page_content.py |
| @@ -0,0 +1,19 @@ |
| +#!/usr/bin/env python2 |
|
Vasily Kuznetsov
2017/08/16 18:34:56
I think we've discussed this and I have suggested
rosie
2017/08/19 01:56:34
Done.
|
| + |
| +import os |
| + |
| +from cms.converters import parse_page_content |
| + |
| +test_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), |
| + 'frontmatter_samples') |
| + |
| + |
| +def test_parse_page_content(): |
| + page = 'test_page_name' |
| + with open(os.path.join(test_path, 'front_matter_orig.html')) as orig_data: |
| + orig_content = orig_data.read() |
| + orig = parse_page_content(page, orig_content) |
| + with open(os.path.join(test_path, 'front_matter_json.html')) as json_data: |
| + json_content = json_data.read() |
| + json = parse_page_content(page, json_content) |
| + assert orig[0] == json[0] |