コード例 #1
0
ファイル: tests.py プロジェクト: rhythm1995/sentry
    def test_get_participants(self):
        organization = self.create_organization(owner=self.create_user())
        team = self.create_team(organization=organization)
        project = self.create_project(organization=organization, team=team)
        group = self.create_group(project=project)

        actor = self.create_user()
        other = self.create_user()

        for user in (actor, other):
            self.create_member([team], user=user, organization=organization)
            GroupSubscription.objects.subscribe(group, user)

        email = ActivityEmail(
            Activity(
                project=group.project,
                group=group,
                user=actor,
            )
        )

        assert email.get_participants() == set([other])

        UserOption.objects.set_value(
            user=actor,
            project=None,
            key='self_notifications',
            value='1'
        )

        assert email.get_participants() == set([actor, other])
コード例 #2
0
ファイル: tests.py プロジェクト: mingyaaaa/sentry
    def test_get_participants(self):
        group, (actor, other) = self.get_fixture_data(2)

        email = ActivityEmail(Activity(project=group.project, group=group, user=actor))

        assert set(email.get_participants()) == set([other])

        UserOption.objects.set_value(user=actor, key="self_notifications", value="1")

        assert set(email.get_participants()) == set([actor, other])
コード例 #3
0
ファイル: tests.py プロジェクト: Kayle009/sentry
    def test_get_participants(self):
        group, (actor, other) = self.get_fixture_data(2)

        email = ActivityEmail(Activity(
            project=group.project,
            group=group,
            user=actor,
        ))

        assert set(email.get_participants()) == set([other])

        UserOption.objects.set_value(user=actor, key='self_notifications', value='1')

        assert set(email.get_participants()) == set([actor, other])
コード例 #4
0
    def test_get_participants_without_actor(self):
        group, (user, ) = self.get_fixture_data(1)

        email = ActivityEmail(Activity(
            project=group.project,
            group=group,
        ))

        assert set(email.get_participants()) == set([user])
コード例 #5
0
ファイル: tests.py プロジェクト: Kayle009/sentry
    def test_get_participants_without_actor(self):
        group, (user, ) = self.get_fixture_data(1)

        email = ActivityEmail(Activity(
            project=group.project,
            group=group,
        ))

        assert set(email.get_participants()) == set([user])