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