Exemple #1
0
    def test_groups(self):
        other_group = self.create_group()
        other_incident = self.create_incident(
            date_started=self.now - timedelta(minutes=5),
            query="",
            projects=[],
            groups=[other_group],
        )

        params = bulk_build_incident_query_params([self.group_incident, other_incident])
        assert bulk_get_incident_aggregates(params) == [
            {"count": 4, "unique_users": 2},
            {"count": 0, "unique_users": 0},
        ]
Exemple #2
0
    def test_projects(self):
        other_project = self.create_project()
        other_incident = self.create_incident(
            date_started=self.now - timedelta(minutes=5),
            query='',
            projects=[other_project],
            groups=[],
        )
        params = bulk_build_incident_query_params(
            [self.project_incident, other_incident])

        assert bulk_get_incident_aggregates(params) == [
            {
                'count': 4,
                'unique_users': 2
            },
            {
                'count': 0,
                'unique_users': 0
            },
        ]