|
12 | 12 | @pytest.fixture |
13 | 13 | def pagarme_responses(transaction_json, captura_json): |
14 | 14 | with responses.RequestsMock() as rsps: |
15 | | - rsps.add(responses.GET, f'https://api.pagar.me/1/transactions/{TOKEN}', json=transaction_json) |
16 | | - rsps.add(responses.POST, f'https://api.pagar.me/1/transactions/{TOKEN}/capture', json=captura_json) |
| 15 | + rsps.add(responses.GET, f'https://api.pagar.me/1/transactions/{TRANSACTION_ID}', json=transaction_json) |
| 16 | + rsps.add(responses.POST, f'https://api.pagar.me/1/transactions/{TRANSACTION_ID}/capture', json=captura_json) |
17 | 17 | yield rsps |
18 | 18 |
|
19 | 19 |
|
20 | 20 | TRANSACTION_ID = 7656690 |
21 | | -TOKEN = 'test_transaction_aJx9ibUmRqYcQrrUaNtQ3arTO4tF1z' |
22 | 21 | BOLETO_URL = 'www.some.boleto.com' |
23 | 22 | BOLETO_BARCODE = '123455' |
24 | 23 |
|
@@ -53,8 +52,9 @@ def sync_on_discourse_mock(mocker): |
53 | 52 | @pytest.fixture |
54 | 53 | def resp(client, pagarme_responses, create_or_update_lead_mock, payment_handler_task_mock, tag_as_mock, |
55 | 54 | active_product_item, sync_on_discourse_mock): |
56 | | - return client.get(reverse('django_pagarme:capture', kwargs={'token': TOKEN, 'slug': active_product_item.slug}), |
57 | | - secure=True) |
| 55 | + return client.get( |
| 56 | + reverse('django_pagarme:capture', kwargs={'token': TRANSACTION_ID, 'slug': active_product_item.slug}) |
| 57 | + ) |
58 | 58 |
|
59 | 59 |
|
60 | 60 | def test_status_code(resp): |
@@ -95,7 +95,7 @@ def test_created_user_tagged_with_boleto(resp, django_user_model, tag_as_mock, a |
95 | 95 | def resp_logged_user(client_with_lead, pagarme_responses, payment_handler_task_mock, tag_as_mock, active_product_item, |
96 | 96 | remove_tags_mock): |
97 | 97 | return client_with_lead.get( |
98 | | - reverse('django_pagarme:capture', kwargs={'token': TOKEN, 'slug': active_product_item.slug}), |
| 98 | + reverse('django_pagarme:capture', kwargs={'token': TRANSACTION_ID, 'slug': active_product_item.slug}), |
99 | 99 | secure=True |
100 | 100 | ) |
101 | 101 |
|
|
0 commit comments