Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_parse_page_content.py

Issue 29516687: Issue 4488 - Add support for JSON page front matter (Closed) Base URL: https://hg.adblockplus.org/cms
Patch Set: Created Aug. 16, 2017, 12:43 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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]

Powered by Google App Engine
This is Rietveld