Completed
Push — master ( 1416b0...4481f2 )
by Batiste
01:49
created

PluginTestCase   A

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
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