Ejemplo n.º 1
0
 def test_json_loads(self):
     jsondata = """{
         "portal_type": "ArticleReference",
         "attributes": {"title": "Updated title"
     }"""
     with self.assertRaises(ContentTypeLoadError):
         JsonContentType.loads(jsondata)
Ejemplo n.º 2
0
    def get_previewdata(cls, pydata):
        """
        Get the data that should be added to the data preview box.

        :return: A string containing the data.
        """
        return JsonContentType.dumps(pydata)
Ejemplo n.º 3
0
 def test_json_dumps(self):
     from datetime import date
     with self.assertRaises(ContentTypeDumpError):
         JsonContentType.dumps(date(2010, 1, 1))