Example #1
0
    def setUp(self):
        super(TestCreateTargetedMessageCommand, self).setUp()

        self.client = client.PushwooshClient()
        self.command = CreateTargetedMessageCommand()
        self.command.auth = PW_TOKEN
        self.command.content = "Hello world!"
Example #2
0
    def setUp(self):
        super(TestCreateMessageCommand, self).setUp()

        self.client = client.PushwooshClient()
        self.notification = Notification()
        self.notification.content = 'Hello world!'
        self.auth = PW_TOKEN
Example #3
0
    def setUp(self):
        self.code = '0000-0000'
        self.auth = 'test_auth'

        self.client = client.PushwooshClient()
        self.command = CreateTargetedMessageCommand()
        self.command.auth = self.auth
        self.command.content = "Hello world!"
Example #4
0
    def perform_create(self, serializer):
        hwid = serializer.validated_data.pop("hwid")
        language = serializer.validated_data.pop("language")

        push_client = client.PushwooshClient()
        command = RegisterDeviceCommand(yak_settings.PUSHWOOSH_APP_CODE, hwid, constants.PLATFORM_IOS,
                                        serializer.validated_data["token"], language)
        response = push_client.invoke(command)

        if response["status_code"] != 200:
            raise AuthenticationFailed("Authentication with notification service failed")

        serializer.save(user=self.request.user)
Example #5
0
    def setUp(self):
        super(TestDeviceCommands, self).setUp()

        self.client = client.PushwooshClient()
        self.auth = PW_TOKEN
        self.hwid = str(uuid.uuid4())
        self.push_token = str(uuid.uuid4())
        self.app_code = PW_APP_CODE

        # Register device for tests
        command = RegisterDeviceCommand(self.app_code, self.hwid,
                                        constants.PLATFORM_ANDROID,
                                        self.push_token)
        self.client.invoke(command)
Example #6
0
    def setUp(self):
        if PW_TOKEN is None:
            raise unittest.case.SkipTest(
                'Environment variable PW_TOKEN is not set.')
        if PW_APP_CODE is None:
            raise unittest.case.SkipTest(
                'Environment variable PW_APP_CODE is not set.')
        if PW_APP_GROUP_CODE is None:
            raise unittest.case.SkipTest(
                'Environment variable PW_APP_GROUP_CODE is not set.')

        self.client = client.PushwooshClient()
        self.client.debug = True

        super(IntegrationTestCase, self).setUp()
Example #7
0
 def setUp(self):
     self.client = client.PushwooshClient()
     self.notification = Notification()
     self.notification.content = 'Hello world!'
     self.auth = 'test_auth'
     self.code = '0000-0000'
Example #8
0
 def setUp(self):
     self.client = client.PushwooshClient()
     self.auth = 'test_auth'
     self.hwid = str(uuid.uuid4())
     self.push_token = str(uuid.uuid4())
     self.app_code = '0000-0000'
Example #9
0
 def setUp(self):
     self.client = client.PushwooshClient()
     self.command = CompileFilterCommand()
     self.code = '0000-0000'
Example #10
0
 def setUp(self):
     self.client = client.PushwooshClient()
     self.command = DeleteMessageCommand()
     self.auth = 'Test auth'
     self.command.auth = self.auth
Example #11
0
    def setUp(self):
        super(TestDeleteMessageCommand, self).setUp()

        self.client = client.PushwooshClient()
        self.command = DeleteMessageCommand()
Example #12
0
    def setUp(self):
        super(TestCompileFilterCommand, self).setUp()

        self.client = client.PushwooshClient()
        self.command = CompileFilterCommand()