Exemple #1
0
 def test_list_tuples(self):
     widget = text_widget(lambda r: [("test1", TEXT_NONE),
             ("test2", TEXT_INFO), ("test3", TEXT_WARN)])
     resp = widget(self.request)
     self.assertEqual('{"item": [{"text": "test1", "type": 0}, '
             '{"text": "test2", "type": 2}, '
             '{"text": "test3", "type": 1}]}', resp.content)
Exemple #2
0
 def test_list_tuples(self):
     widget = text_widget(lambda r: [("test1", TEXT_NONE),
             ("test2", TEXT_INFO), ("test3", TEXT_WARN)])
     resp = widget(self.request)
     self.assertEqual('{"item": [{"text": "test1", "type": 0}, '
             '{"text": "test2", "type": 2}, '
             '{"text": "test3", "type": 1}]}', resp.content)
 def test_list(self):
     widget = text_widget(lambda r: ["test1", "test2"])
     resp = widget(self.request)
     self.assertJSONEqual(
         ('{"item": [{"text": "test1", "type": 0}, '
          '{"text": "test2", "type": 0}]}'),
         resp.content.decode('utf8'))
 def test_list_tuples(self):
     data = [("test1", TEXT_NONE),
             ("test2", TEXT_INFO),
             ("test3", TEXT_WARN)]
     widget = text_widget(lambda r: data)
     resp = widget(self.request)
     self.assertJSONEqual(
         ('{"item": [{"text": "test1", "type": 0}, '
          '{"text": "test2", "type": 2}, '
          '{"text": "test3", "type": 1}]}'),
         resp.content.decode('utf8'))
Exemple #5
0
 def test_list(self):
     widget = text_widget(lambda r: ["test1", "test2"])
     resp = widget(self.request)
     self.assertEqual('{"item": [{"text": "test1", "type": 0}, '
             '{"text": "test2", "type": 0}]}', resp.content)
Exemple #6
0
 def test_string(self):
     widget = text_widget(lambda r: "test message")
     resp = widget(self.request)
     self.assertEqual('{"item": [{"text": "test message", "type": 0}]}',
             resp.content)
Exemple #7
0
 def test_list(self):
     widget = text_widget(lambda r: ["test1", "test2"])
     resp = widget(self.request)
     self.assertEqual('{"item": [{"text": "test1", "type": 0}, '
             '{"text": "test2", "type": 0}]}', resp.content)
Exemple #8
0
 def test_string(self):
     widget = text_widget(lambda r: "test message")
     resp = widget(self.request)
     self.assertEqual('{"item": [{"text": "test message", "type": 0}]}',
             resp.content)