Commits

Mikhail Korobov committed aadac33

Tests for request ip storage

Comments (0)

Files changed (1)

 
     def setUp(self):
         self.gateway = NetcashGateway.objects.all()[0]
+        self.gateway.netcash_ip = '127.0.0.1'
+        self.gateway.save()
+
+        # reload the gateway
+        self.gateway = NetcashGateway.objects.all()[0]
+
         self.gateway_url = reverse('netcash_data', args = [self.gateway.secret])
 
     def test_invalid_data_request(self):
         self.assertEqual(NetcashOrder.objects.count(), 0)
 
     def test_data_request(self):
-
         # signal handler
         def data_handler(sender, order, **kwargs):
             data_handler.called = True
         self.assertEqual(order.Amount, 100)
         self.assertEqual(order.RETC, '123')
         self.assertEqual(order.gateway, self.gateway)
+        self.assertEqual(order.request_ip, '127.0.0.1')
 
         self.assertTrue(data_handler.called)
         self.assertEqual(data_handler.order, order)