示例#1
0
文件: tests.py 项目: brat002/ebscab
 def test_status_timeout(self):
     balance = 100.00
     error = (1,u'Временная ошибка. Повторите запрос позже',False)
     def callback():
         return {'balance':balance, 'error_code':error[0]}
     pegas = PegasPaymentGateway({}, {'status':callback})
     response = \
         u"""
         <?xml version="1.0" encoding="UTF-8"?>
             <response>
               <result>%(error)d</result>
               <comment>%(comment)s</comment>
             </response>""" % {'error':error[0], 'comment':error[1]}
     self.assertEquals(pegas.status(), (response, error))
示例#2
0
 def test_status_timeout(self):
     balance = 100.00
     error = (1,u'Временная ошибка. Повторите запрос позже',False)
     def callback():
         return {'balance':balance, 'error_code':error[0]}
     pegas = PegasPaymentGateway({}, {'status':callback})
     response = \
         u"""
         <?xml version="1.0" encoding="UTF-8"?>
             <response>
               <result>%(error)d</result>
               <comment>%(comment)s</comment>
             </response>""" % {'error':error[0], 'comment':error[1]}
     self.assertEquals(pegas.status(), (response, error))
示例#3
0
文件: tests.py 项目: brat002/ebscab
 def test_status_ok(self):
     balance = 100.00
     error = (0,u'ОК',False)
     def callback():
         return {'balance':balance, 'error_code':error[0]}
     pegas = PegasPaymentGateway({}, {'status':callback})
     response = \
         u"""
         <?xml version="1.0" encoding="UTF-8"?>
             <response>
               <result>%(error)d</result>
               <balance>%(ballance).02f</balance>
             </response>""" % {'error':error[0], 'ballance':balance}
     self.assertEquals(pegas.status(), (response, error))
示例#4
0
 def test_status_ok(self):
     balance = 100.00
     error = (0,u'ОК',False)
     def callback():
         return {'balance':balance, 'error_code':error[0]}
     pegas = PegasPaymentGateway({}, {'status':callback})
     response = \
         u"""
         <?xml version="1.0" encoding="UTF-8"?>
             <response>
               <result>%(error)d</result>
               <balance>%(ballance).02f</balance>
             </response>""" % {'error':error[0], 'ballance':balance}
     self.assertEquals(pegas.status(), (response, error))