예제 #1
0
 def setUp(self):
     self.api_name = 'paypal'
     self.uid = 'sample:uid'
     self.seller, self.paypal, self.product = make_seller_paypal(self.uid)
     self.paypal.token = 'f'
     self.paypal.secret = 'b'
     self.paypal.save()
예제 #2
0
 def setUp(self):
     self.api_name = 'paypal'
     self.uid = 'sample:uid'
     self.seller, self.paypal, self.product = make_seller_paypal(self.uid)
     self.paypal.token = 'f'
     self.paypal.secret = 'b'
     self.paypal.save()
예제 #3
0
 def setUp(self):
     self.api_name = 'paypal'
     self.uuid = 'sample:uid'
     self.list_url = self.get_list_url('ipn')
     self.seller, self.paypal, self.product = make_seller_paypal(self.uuid)
     self.transaction = Transaction.objects.create(uuid='5678',
         provider=transaction_constants.SOURCE_PAYPAL,
         seller_product=self.product, amount='10', uid_support='123')
예제 #4
0
 def setUp(self):
     self.api_name = 'paypal'
     self.uuid = 'sample:uid'
     self.list_url = self.get_list_url('transaction')
     self.seller, self.paypal = make_seller_paypal('paypal:%s' % self.uuid)
     self.trans = PaypalTransaction.objects.create(amount=5,
                                                   seller=self.paypal,
                                                   uuid=self.uuid)
     self.detail_url = self.get_detail_url('transaction', self.trans.pk)
예제 #5
0
 def test_filter(self):
     seller, paypal, product = make_seller_paypal('some:other:uuid')
     self.first = Transaction.objects.create(provider=1,
         seller_product=product, uuid='uuid')
     name = NamedTemporaryFile().name
     generate_log(datetime.today(), name)
     with open(name, 'rb') as csvfile:
         output = csv.reader(csvfile)
         eq_(next(output)[0], 'version')
         eq_(next(output)[1], 'uuid')
예제 #6
0
 def setUp(self):
     self.api_name = 'paypal'
     self.uuid = 'sample:uid'
     self.list_url = self.get_list_url('ipn')
     self.seller, self.paypal, self.product = make_seller_paypal(self.uuid)
     self.transaction = Transaction.objects.create(
         uuid='5678',
         provider=transaction_constants.PROVIDER_PAYPAL,
         seller_product=self.product,
         amount='10',
         uid_support='123')
예제 #7
0
 def setUp(self):
     self.api_name = 'bango'
     self.refund_uuid = 'sample:refund'
     self.seller, self.paypal, self.product = (
         make_seller_paypal('webpay:sample:uid'))
     self.refund = Transaction.objects.create(
         amount=5, seller_product=self.product,
         type=constants.TYPE_REFUND,
         provider=constants.PROVIDER_BANGO,
         uuid=self.refund_uuid, uid_pay='asd',
         status=constants.STATUS_COMPLETED)
     self.url = '/bango/refund/status/'
예제 #8
0
파일: test_api.py 프로젝트: diox/solitude
 def setUp(self):
     self.api_name = 'generic'
     self.uuid = 'sample:uid'
     self.list_url = self.get_list_url('transaction')
     self.seller, self.paypal, self.product = (
         make_seller_paypal('paypal:%s' % self.uuid))
     self.trans = Transaction.objects.create(
         amount=5, seller_product=self.product,
         provider=constants.SOURCE_PAYPAL, uuid=self.uuid)
     self.detail_url = reverse('api_dispatch_detail',
                               kwargs={'api_name': self.api_name,
                                       'resource_name': 'transaction',
                                       'pk': self.trans.pk})
예제 #9
0
 def setUp(self):
     self.api_name = "bango"
     self.refund_uuid = "sample:refund"
     self.seller, self.paypal, self.product = make_seller_paypal("webpay:sample:uid")
     self.refund = Transaction.objects.create(
         amount=5,
         seller_product=self.product,
         type=constants.TYPE_REFUND,
         provider=constants.PROVIDER_BANGO,
         uuid=self.refund_uuid,
         uid_pay="asd",
         status=constants.STATUS_COMPLETED,
     )
     self.url = "/bango/refund/status/"
예제 #10
0
 def setUp(self):
     self.api_name = 'bango'
     self.uuid = 'sample:uid'
     self.seller, self.paypal, self.product = (
         make_seller_paypal('webpay:sample:uid'))
     self.trans = Transaction.objects.create(
         amount=5, seller_product=self.product,
         provider=constants.PROVIDER_BANGO, uuid=self.uuid,
         status=constants.STATUS_COMPLETED)
     self.url = self.get_list_url('refund')
     self.seller_bango = SellerBango.objects.create(seller=self.seller,
                             package_id=1, admin_person_id=3,
                             support_person_id=3, finance_person_id=4)
     SellerProductBango.objects.create(seller_product=self.product,
                                       seller_bango=self.seller_bango,
                                       bango_id='1234')
예제 #11
0
 def setUp(self):
     self.api_name = 'generic'
     self.uuid = 'sample:uid'
     self.list_url = self.get_list_url('transaction')
     self.seller, self.paypal, self.product = (make_seller_paypal(
         'paypal:%s' % self.uuid))
     self.trans = Transaction.objects.create(
         amount=5,
         seller_product=self.product,
         provider=constants.PROVIDER_PAYPAL,
         uuid=self.uuid)
     self.detail_url = reverse('api_dispatch_detail',
                               kwargs={
                                   'api_name': self.api_name,
                                   'resource_name': 'transaction',
                                   'pk': self.trans.pk
                               })
예제 #12
0
 def setUp(self):
     self.name = NamedTemporaryFile().name
     seller, paypal, self.product = make_seller_paypal('some:other:uuid')
     self.first = Transaction.objects.create(provider=1,
         seller_product=self.product, uuid='uuid')