def setUp(self): super(TestCreateMessageCommand, self).setUp() self.client = client.PushwooshClient() self.notification = Notification() self.notification.content = 'Hello world!' self.auth = PW_TOKEN
def test_invalid_filtered_notification(self): notification = Notification() notification.filter = 'filter_name' notification.conditions = filter.ApplicationFilter('0000-0000') self.assertRaises(PushwooshNotificationException, notification.render)
def setUp(self): self.notification = Notification()
def setUp(self): self.client = client.PushwooshClient() self.notification = Notification() self.notification.content = 'Hello world!' self.auth = 'test_auth' self.code = '0000-0000'
from pypushwoosh.client import PushwooshClient from pypushwoosh.command import CreateMessageForApplicationCommand from pypushwoosh.notification import Notification AUTH_TOKEN = 'AUTH_TOKEN' APPLICATION_CODE = 'APP-CODE' notification = Notification() notification.content = 'Hello world!' notification.devices = [ 'PUSH_TOKEN_0', 'PUSH_TOKEN_1', ] command = CreateMessageForApplicationCommand(notification, APPLICATION_CODE) command.auth = AUTH_TOKEN client = PushwooshClient() response = client.invoke(command)