def test_incorrect_action(client, url, subscription):
    response = client.get(url,
                          data={
                              "action": "other",
                              "token": subscription.token
                          })
    assert subscription_confirmed(subscription) is False
    assert error_message_shown(response)
def test_incorrect_token(client, url, subscription):
    response = client.get(url,
                          data={
                              "action": "confirm",
                              "token": get_random_string(40)
                          })
    assert subscription_confirmed(subscription) is False
    assert error_message_shown(response)
Ejemplo n.º 3
0
def test_send_failed(mocked, client, url, data):
    mocked.return_value = False
    response = client.post(url, data=data)
    assert form_is_bound(response)
    assert error_message_shown(response)
    assert contact_email_sent() is False
Ejemplo n.º 4
0
def test_missing_token(client, url, subscription):
    response = client.get(url, data={"action": "cancel"})
    assert subscription_cancelled(subscription) is False
    assert error_message_shown(response)
def test_missing_action(client, url, subscription):
    response = client.get(url, data={"token": subscription.token})
    assert subscription_confirmed(subscription) is False
    assert error_message_shown(response)