def test_json_loads(self): jsondata = """{ "portal_type": "ArticleReference", "attributes": {"title": "Updated title" }""" with self.assertRaises(ContentTypeLoadError): JsonContentType.loads(jsondata)
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)
def test_json_dumps(self): from datetime import date with self.assertRaises(ContentTypeDumpError): JsonContentType.dumps(date(2010, 1, 1))