Esempio n. 1
0
 def setUp(self):
     default_accounts()
     self.payload = {
         'start_date': '2012-01-01T09:00:00+03:00',
         'end_date': '2019-06-01T09:00:00+03:00',
         'amount': '400.00',
     }
 def setUp(self):
     default_accounts()
     self.payload = {
         'start_date': '2012-01-01T09:00:00+03:00',
         'end_date': '2019-06-01T09:00:00+03:00',
         'amount': '400.00',
     }
    def setUp(self):
        default_accounts()
        self.create_payload = {
            'start_date': '2012-01-01T09:00:00+03:00',
            'end_date': '2019-06-01T09:00:00+03:00',
            'amount': '400.00',
            'account_type': 'Test accounts',
        }
        self.create_response = post(
            reverse('accounts'), self.create_payload)
        self.detail_response = get(self.create_response['Location'])

        self.redeem_payload = {
            'amount': '50.00',
            'merchant_reference': '1234'
        }
        account_dict = to_json(self.detail_response)
        redemption_url = account_dict['redemptions_url']
        self.redeem_response = post(redemption_url, self.redeem_payload)

        self.refund_payload = {
            'amount': '25.00',
            'merchant_reference': '1234',
        }
        refund_url = account_dict['refunds_url']
        self.refund_response = post(refund_url, self.refund_payload)
Esempio n. 4
0
 def setUp(self):
     default_accounts()
     self.payload = {
         'start_date': '2013-01-01T09:00:00+03:00',
         'end_date': '2019-06-01T09:00:00+03:00',
         'amount': '400.00',
         'account_type': 'Test accounts',
     }
     # Submit request to create a new account, then fetch the detail
     # page that is returned.
     self.create_response = post(reverse('accounts'), self.payload)
     if 'Location' in self.create_response:
         self.detail_response = get(self.create_response['Location'])
         self.payload = to_json(self.detail_response)
         self.account = models.Account.objects.get(
             code=self.payload['code'])
 def setUp(self):
     default_accounts()
     self.payload = {
         'start_date': '2013-01-01T09:00:00+03:00',
         'end_date': '2019-06-01T09:00:00+03:00',
         'amount': '400.00',
         'account_type': 'Test accounts',
     }
     # Submit request to create a new account, then fetch the detail
     # page that is returned.
     self.create_response = post(reverse('accounts'), self.payload)
     if 'Location' in self.create_response:
         self.detail_response = get(
             self.create_response['Location'])
         self.payload = to_json(self.detail_response)
         self.account = models.Account.objects.get(
             code=self.payload['code'])
Esempio n. 6
0
    def setUp(self):
        default_accounts()
        self.create_payload = {
            'start_date': '2012-01-01T09:00:00+03:00',
            'end_date': '2019-06-01T09:00:00+03:00',
            'amount': '400.00',
            'account_type': 'Test accounts',
        }
        self.create_response = post(reverse('accounts'), self.create_payload)
        self.assertEqual(201, self.create_response.status_code)
        self.detail_response = get(self.create_response['Location'])
        redemption_url = to_json(self.detail_response)['redemptions_url']

        self.redeem_payload = {'amount': '50.00', 'merchant_reference': '1234'}
        self.redeem_response = post(redemption_url, self.redeem_payload)

        transfer_url = self.redeem_response['Location']
        self.transfer_response = get(transfer_url)
Esempio n. 7
0
    def setUp(self):
        default_accounts()
        self.create_payload = {
            'start_date': '2012-01-01T09:00:00+03:00',
            'end_date': '2019-06-01T09:00:00+03:00',
            'amount': '400.00',
            'account_type': 'Test accounts',
        }
        self.create_response = post(reverse('accounts'), self.create_payload)
        self.detail_response = get(self.create_response['Location'])

        self.redeem_payload = {'amount': '50.00', 'merchant_reference': '1234'}
        account_dict = to_json(self.detail_response)
        redemption_url = account_dict['redemptions_url']
        self.redeem_response = post(redemption_url, self.redeem_payload)

        self.refund_payload = {
            'amount': '25.00',
            'merchant_reference': '1234',
        }
        refund_url = account_dict['refunds_url']
        self.refund_response = post(refund_url, self.refund_payload)
    def setUp(self):
        default_accounts()
        self.create_payload = {
            'start_date': '2012-01-01T09:00:00+03:00',
            'end_date': '2019-06-01T09:00:00+03:00',
            'amount': '400.00',
            'account_type': 'Test accounts',
        }
        self.create_response = post(reverse('accounts'), self.create_payload)
        self.assertEqual(201, self.create_response.status_code)
        self.detail_response = get(self.create_response['Location'])
        redemption_url = to_json(self.detail_response)['redemptions_url']

        self.redeem_payload = {
            'amount': '50.00',
            'merchant_reference': '1234'
        }
        self.redeem_response = post(redemption_url, self.redeem_payload)

        transfer_url = self.redeem_response['Location']
        self.transfer_response = get(
            transfer_url)
Esempio n. 9
0
 def setUp(self):
     default_accounts()
     self.staff = UserFactory(is_staff=True)
 def setUp(self):
     default_accounts()
     self.staff = UserFactory(is_staff=True)