Exemplo n.º 1
0
 def test_get_incoming_data(self):
     """get_incoming_data should return matching text and connection."""
     data = {'identity': '1112223333', 'text': 'hi there'}
     form = GenericHttpForm(data, backend_name='http-backend')
     form.is_valid()
     incoming_data = form.get_incoming_data()
     self.assertEqual(data['text'], incoming_data['text'])
     self.assertEqual(data['identity'],
                      incoming_data['connection'].identity)
     self.assertEqual('http-backend',
                      incoming_data['connection'].backend.name)