def test_downsell_slug_template(client, pagarme_responses, upsell_item):
    path = reverse('django_pagarme:capture', kwargs={'token': TRANSACTION_ID, 'slug': upsell_item.slug})
    resp = client.get(path)

    assert_templates_not_used(resp, 'django_pagarme/show_boleto_data.html')
    assert_templates_used(resp, 'django_pagarme/show_boleto_data_upsell_item.html')
def test_downsell_fall_back_template(resp, payment_item, upsell_item):
    assert_templates_used(resp, 'django_pagarme/show_boleto_data.html')
    assert_templates_not_used(resp, 'django_pagarme/show_boleto_data_paytment_item.html')
def test_slug_template(client, upsell_item):
    resp = client.get(
        reverse('django_pagarme:pagarme', kwargs={'slug': upsell_item.slug}))
    assert_templates_not_used(resp, 'django_pagarme/pagarme.html')
    assert_templates_used(resp, 'django_pagarme/pagarme_upsell_item.html')
def test_fall_back_template(resp, payment_item, upsell_item):
    assert_templates_used(resp, 'django_pagarme/pagarme.html')
    assert_templates_not_used(resp, 'django_pagarme/pagarme_payment_item.html')
Example #5
0
def test_thanks_with_slug_suffix_used(client, upsell):
    resp = client.get(
        reverse('django_pagarme:thanks', kwargs={'slug': upsell.slug}))
    assert_templates_not_used(resp, 'django_pagarme/thanks.html')
    assert_templates_used(resp, 'django_pagarme/thanks_upsell_slug.html')
Example #6
0
def test_thanks_fallback_used(resp, payment_item):
    assert_templates_used(resp, 'django_pagarme/thanks.html')
    assert_templates_not_used(resp, 'django_pagarme/thanks_item_slug.html')