Exemplo n.º 1
0
 def test_get_incoming_data(self):
     """get_incoming_data should return matching text and connection."""
     data = {"id": "1112223333", "text": "hi there"}
     form = KannelForm(data, backend_name="kannel-backend")
     form.is_valid()
     incoming_data = form.get_incoming_data()
     self.assertEqual(data["text"], incoming_data["text"])
     self.assertEqual(data["id"], incoming_data["connection"].identity)
     self.assertEqual("kannel-backend", incoming_data["connection"].backend.name)
Exemplo n.º 2
0
 def test_get_incoming_data(self):
     """get_incoming_data should return matching text and connection."""
     data = {'id': '1112223333', 'text': 'hi there'}
     form = KannelForm(data, backend_name='kannel-backend')
     form.is_valid()
     incoming_data = form.get_incoming_data()
     self.assertEqual(data['text'], incoming_data['text'])
     self.assertEqual(data['id'], incoming_data['connection'].identity)
     self.assertEqual('kannel-backend',
                      incoming_data['connection'].backend.name)
Exemplo n.º 3
0
 def test_get_incoming_data(self):
     """get_incoming_data should return matching text and connection."""
     data = {'id': '1112223333', 'text': 'hi there'}
     form = KannelForm(data, backend_name='kannel-backend')
     form.is_valid()
     incoming_data = form.get_incoming_data()
     self.assertEqual(data['text'], incoming_data['text'])
     self.assertEqual(data['id'],
                      incoming_data['connection'].identity)
     self.assertEqual('kannel-backend',
                      incoming_data['connection'].backend.name)
Exemplo n.º 4
0
 def test_invalid_form(self):
     """Form is invalid if POST keys don't match configuration."""
     data = {'invalid-phone': '1112223333', 'invalid-message': 'hi there'}
     form = KannelForm(data, backend_name='kannel-backend')
     self.assertFalse(form.is_valid())
Exemplo n.º 5
0
 def test_valid_form(self):
     """Form should be valid if GET keys match configuration."""
     data = {'id': '1112223333', 'text': 'hi there'}
     form = KannelForm(data, backend_name='kannel-backend')
     self.assertTrue(form.is_valid())
Exemplo n.º 6
0
 def test_invalid_form(self):
     """Form is invalid if POST keys don't match configuration."""
     data = {"invalid-phone": "1112223333", "invalid-message": "hi there"}
     form = KannelForm(data, backend_name="kannel-backend")
     self.assertFalse(form.is_valid())
Exemplo n.º 7
0
 def test_valid_form(self):
     """Form should be valid if GET keys match configuration."""
     data = {"id": "1112223333", "text": "hi there"}
     form = KannelForm(data, backend_name="kannel-backend")
     self.assertTrue(form.is_valid())
Exemplo n.º 8
0
 def test_invalid_form(self):
     """Form is invalid if POST keys don't match configuration."""
     data = {'invalid-phone': '1112223333', 'invalid-message': 'hi there'}
     form = KannelForm(data, backend_name='kannel-backend')
     self.assertFalse(form.is_valid())
Exemplo n.º 9
0
 def test_valid_form(self):
     """Form should be valid if GET keys match configuration."""
     data = {'id': '1112223333', 'text': 'hi there'}
     form = KannelForm(data, backend_name='kannel-backend')
     self.assertTrue(form.is_valid())