def test_ToJSON(self):
     iclist = InteractionComponentList(
         [{"id": "test1", "description": {"en-US": "test1"}}, {"id": "test2", "description": {"en-US": "test2"}}])
     # since the map is unordered, it is ok that to_json() changes ordering
     self.assertEqual(iclist.to_json(),
                      '[{"id": "test1", "description": {"en-US": "test1"}}, '
                      '{"id": "test2", "description": {"en-US": "test2"}}]')
Exemple #2
0
 def test_ToJSON(self):
     iclist = InteractionComponentList([{
         "id": "test1",
         "description": {
             "en-US": "test1"
         }
     }, {
         "id": "test2",
         "description": {
             "en-US": "test2"
         }
     }])
     # since the map is unordered, it is ok that to_json() changes ordering
     self.assertEqual(
         json.loads(iclist.to_json()),
         json.loads('[{"id": "test1", "description": {"en-US": "test1"}}, '
                    '{"id": "test2", "description": {"en-US": "test2"}}]'))