Example #1
0
 def test_b2c__post_save_signal(self, mock_signal, mock_post, mock_get):
     post_save.connect(mock_signal,
                       sender=B2CRequest,
                       dispatch_uid='test_b2c_request_post_save')
     Mpesa.b2c_request(phone=254708374149, amount=100.0)
     self.assertEquals(mock_signal.call_count, 1)
     post_save.disconnect(mock_signal,
                          sender=B2CRequest,
                          dispatch_uid='test_b2c_request_post_save')
Example #2
0
 def setUp(self):
     self.req = Mpesa.b2c_request(phone=254708374149, amount=100.0)