Exemplo n.º 1
0
 def setUp(self):
     super().setUp()
     self.external_id = "slack:1"
     self.integration = install_slack(self.organization, self.external_id)
     self.idp = IdentityProvider.objects.create(type="slack",
                                                external_id="slack:1",
                                                config={})
     self.login_as(self.user)
Exemplo n.º 2
0
    def setUp(self):
        super().setUp()
        self.external_id = "slack:1"
        self.integration = install_slack(self.organization)
        self.idp = add_identity(self.integration, self.user, self.external_id)

        self.trigger_id = "13345224609.738474920.8088930838d88f008e0"
        self.response_url = (
            "https://hooks.slack.com/actions/T47563693/6204672533/x7ZLaiVMoECAW50Gw1ZYAXEM"
        )
Exemplo n.º 3
0
    def setUp(self):
        self.integration = install_slack(self.organization)
        self.uuid = uuid4().hex

        channels = {"ok": "true", "channels": [{"name": "my-channel", "id": "chan-id"}]}

        responses.add(
            method=responses.GET,
            url="https://slack.com/api/conversations.list",
            status=200,
            content_type="application/json",
            body=json.dumps(channels),
        )
Exemplo n.º 4
0
    def setUp(self):
        self.resp = responses.mock
        self.resp.__enter__()

        self.integration = install_slack(self.event.project.organization)
        self.add_list_response(
            "conversations",
            [
                {
                    "name": "my-channel",
                    "id": "m-c"
                },
                {
                    "name": "other-chann",
                    "id": "o-c"
                },
                {
                    "name": "my-private-channel",
                    "id": "m-p-c",
                    "is_private": True
                },
            ],
            result_name="channels",
        )
        self.add_list_response(
            "users",
            [
                {
                    "name": "first-morty",
                    "id": "m",
                    "profile": {
                        "display_name": "Morty"
                    }
                },
                {
                    "name": "other-user",
                    "id": "o-u",
                    "profile": {
                        "display_name": "Jimbob"
                    }
                },
                {
                    "name": "better_morty",
                    "id": "bm",
                    "profile": {
                        "display_name": "Morty"
                    }
                },
            ],
            result_name="members",
        )
Exemplo n.º 5
0
 def setUp(self):
     NotificationSetting.objects.update_settings(
         ExternalProviders.SLACK,
         NotificationSettingTypes.WORKFLOW,
         NotificationSettingOptionValues.ALWAYS,
         user=self.user,
     )
     NotificationSetting.objects.update_settings(
         ExternalProviders.SLACK,
         NotificationSettingTypes.DEPLOY,
         NotificationSettingOptionValues.ALWAYS,
         user=self.user,
     )
     NotificationSetting.objects.update_settings(
         ExternalProviders.SLACK,
         NotificationSettingTypes.ISSUE_ALERTS,
         NotificationSettingOptionValues.ALWAYS,
         user=self.user,
     )
     UserOption.objects.create(user=self.user,
                               key="self_notifications",
                               value="1")
     self.integration = install_slack(self.organization)
     self.idp = IdentityProvider.objects.create(type="slack",
                                                external_id="TXXXXXXX1",
                                                config={})
     self.identity = Identity.objects.create(
         external_id="UXXXXXXX1",
         idp=self.idp,
         user=self.user,
         status=IdentityStatus.VALID,
         scopes=[],
     )
     responses.add(
         method=responses.POST,
         url="https://slack.com/api/chat.postMessage",
         body='{"ok": true}',
         status=200,
         content_type="application/json",
     )
     self.name = self.user.get_display_name()
     self.short_id = self.group.qualified_short_id
 def setUp(self):
     self.integration = install_slack(self.get_event().project.organization)
Exemplo n.º 7
0
    def setUp(self):
        super().setUp()
        self.integration = install_slack(self.organization)

        self.request = RequestFactory().get("slack/event")
Exemplo n.º 8
0
 def setUp(self):
     super().setUp()
     self.integration = install_slack(self.organization)