Total Complexity | 1 |
Total Lines | 13 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | # -*- coding: utf-8 -*- |
||
14 | class PluginTestCase(TestCase): |
||
15 | """Django page CMS plugin tests.""" |
||
16 | |||
17 | def test_json_parsing(self): |
||
18 | """Test page date ordering feature.""" |
||
19 | self.new_page({'slug': 'p1'}) |
||
20 | self.new_page({'slug': 'p2'}) |
||
21 | jsondata = utils.pages_to_json(Page.objects.all()) |
||
22 | |||
23 | self.assertIn("p1", jsondata) |
||
24 | self.assertIn("p2", jsondata) |
||
25 | data = json.loads(jsondata) |
||
26 | self.assertEqual(len(data['pages']), 2) |
||
27 |