Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tool for check values in API response #13

Open
ttyS15 opened this issue Aug 13, 2020 · 0 comments
Open

Tool for check values in API response #13

ttyS15 opened this issue Aug 13, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@ttyS15
Copy link
Contributor

ttyS15 commented Aug 13, 2020

Usually need to check not only scheme of response but also values in response.

Ex.

        resp = self.send_request(data=reg_data)

        self.assertEqual(status.HTTP_201_CREATED, resp.status_code)
        self.assert_schema(resp.data)
        expected = {
            'status': Order.CREATED,
            'amount': str(reg_data['amount']),
            'client_order_id': reg_data['client_order_id'],
            'pre_auth_payment': reg_data['pre_auth_payment'],
            'payment_gateway': self.payment_gateway,
            'save_payment_method': reg_data['save_payment_method'],
            'recurring_payment': True,
            'pass_id': pass_id,
            'form_url': self.form_url,
            'binding_id': binding.id,
            'refunded_amount': 0,
            'payment_source': None,
        }
        resp.data.pop('id')
        self.assertDictEqual(expected, resp.data)

wants to do in simple way

self.assert_response(expected_dict, response_object, fields=['name', 'value'])

@tumb1er tumb1er added the enhancement New feature or request label Aug 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants