Example #1
0
 def setUp(self):
     create_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',
     }
Example #2
0
    def setUp(self):
        create_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):
     create_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',
     }
Example #4
0
 def setUp(self):
     create_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('oscar_accounts_api: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):
     create_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'])
Example #6
0
    def setUp(self):
        create_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('oscar_accounts_api: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)
    def setUp(self):
        create_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)
Example #8
0
    def setUp(self):
        create_default_accounts()
        self.create_payload = {
            'start_date': '2012-01-01T09:00:00+03:00',
            'end_date': '2019-06-01T09:00:00+03:00',
            'amount': '1000.00',
            'account_type': 'Test accounts',
        }
        self.create_response = post(reverse('oscar_accounts_api:accounts'),
                                    self.create_payload)
        self.detail_response = get(self.create_response['Location'])
        account_dict = to_json(self.detail_response)

        self.redeem_payload = {'amount': '300.00'}
        redemption_url = account_dict['redemptions_url']
        self.redeem_response = post(redemption_url, self.redeem_payload)
        self.transfer_response = get(self.redeem_response['Location'])
        transfer_dict = to_json(self.transfer_response)

        self.refund_payload = {
            'amount': '25.00',
        }
        refund_url = transfer_dict['refunds_url']
        self.refund_response = post(refund_url, self.refund_payload)
Example #9
0
 def handle(self, *args, **options):
     create_default_accounts()
Example #10
0
 def setUp(self):
     create_default_accounts()
     return super().setUp()
Example #11
0
def default_accounts():
    setup.create_default_accounts()
Example #12
0
 def setUp(self):
     create_default_accounts()
     self.staff = UserFactory(is_staff=True)
 def setUp(self):
     create_default_accounts()
     self.staff = UserFactory(is_staff=True)
def default_accounts():
    setup.create_default_accounts()