Example #1
0
def test_quiero_validar_gracias(db, client):
    f = FiscalFactory()
    s = client.session
    s['fiscal_id'] = f.id
    s.save()
    response = client.get(reverse('quiero-validar-gracias'))
    assert response.context['fiscal'] == f
    assert f.ultimo_codigo_url() in response.content.decode('utf8')
Example #2
0
def test_ultimo_codigo_url(db, settings, mocker):
    settings.FULL_SITE_URL = 'https://site.com'
    mocker.patch('fiscales.models.Fiscal.ultimo_codigo', return_value='D10S')
    f = FiscalFactory()
    assert f.ultimo_codigo_url() == 'https://site.com' + reverse(
        'quiero-validar', args=['D10S'])