PluginTestCase   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_json_parsing() 0 10 1
1
# -*- coding: utf-8 -*-
2
"""Django page CMS plugin test suite module."""
3
from pages.tests.testcase import TestCase
4
from pages.plugins.jsonexport import utils
5
from pages.models import Page
6
import json
7
from pages.plugins.jsonexport.tests import JSONExportTestCase
8
9
10
class Dummy(JSONExportTestCase):
11
    pass
12
13
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