Exemplo n.º 1
0
def test_details(client):
    notification = onesignal.SegmentNotification(
        contents={'en': 'Hello World'},
        included_segments=onesignal.SegmentNotification.ACTIVE_USERS)
    notification = client.send(notification)
    details = client.details(notification)
    assert details['failed'] == 0
Exemplo n.º 2
0
def test_details():
    notification = onesignal.SegmentNotification(
        contents={"en": "Hello World"},
        included_segments=onesignal.SegmentNotification.ALL
    )
    client.send(notification)
    details = client.details(notification)
    assert "is_chrome_web" in details.keys()
Exemplo n.º 3
0
def test_cancel(client):
    notification = onesignal.SegmentNotification(
        contents={'en': 'Hello World'},
        included_segments=[onesignal.SegmentNotification.ALL])

    try:
        client.cancel(notification)
        assert False, 'Notification was not sent yet, but was on its way to be canceled'
    except ValueError:
        pass

    client.send(notification)
    assert client.cancel(notification)
Exemplo n.º 4
0
def test_cancel():
    notification = onesignal.SegmentNotification(
        contents={"en": "Hello World"},
        included_segments=[onesignal.SegmentNotification.ALL]
    )

    try:
        client.cancel(notification)
        assert False, (
            "Notification was not sent yet, "
            "but was on it's way to be canceled"
        )
    except ValueError:
        pass

    client.send(notification)
    assert client.cancel(notification)
Exemplo n.º 5
0
def test_send(client):
    notification = onesignal.SegmentNotification(
        contents={'en': 'Hello World'},
        included_segments=[onesignal.SegmentNotification.ALL])
    assert client.send(notification)
Exemplo n.º 6
0
def test_send():
    notification = onesignal.SegmentNotification(
        contents={"en": "Hello World"},
        included_segments=[onesignal.SegmentNotification.ALL]
    )
    assert client.send(notification)