|
@@ -1,5 +1,6 @@
|
|
|
from datetime import timedelta
|
|
|
from functools import cached_property
|
|
|
+from unittest import mock
|
|
|
|
|
|
import pytest
|
|
|
from django.utils import timezone
|
|
@@ -693,7 +694,8 @@ class TagStorageTest(TestCase, SnubaTestCase, SearchIssueTestMixin, PerformanceI
|
|
|
tenant_ids={"referrer": "r", "organization_id": 1234},
|
|
|
) == {self.proj1group1.id: 3, self.proj1group2.id: 1}
|
|
|
|
|
|
- def test_get_group_tag_values_for_users(self):
|
|
|
+ @mock.patch("sentry.analytics.record")
|
|
|
+ def test_get_group_tag_values_for_users(self, mock_record):
|
|
|
result = self.ts.get_group_tag_values_for_users(
|
|
|
[EventUser(project_id=self.proj1.id, ident="user1")],
|
|
|
tenant_ids={"referrer": "r", "organization_id": 1234},
|
|
@@ -718,6 +720,12 @@ class TagStorageTest(TestCase, SnubaTestCase, SearchIssueTestMixin, PerformanceI
|
|
|
assert result[0].value == "user2"
|
|
|
assert result[0].last_seen == self.now - timedelta(seconds=2)
|
|
|
|
|
|
+ mock_record.assert_called_with(
|
|
|
+ "eventuser_endpoint.request",
|
|
|
+ project_id=self.proj1.id,
|
|
|
+ endpoint="sentry.tagstore.snuba.backend.SnubaTagStorage.get_group_tag_values_for_users",
|
|
|
+ )
|
|
|
+
|
|
|
def test_get_release_tags(self):
|
|
|
tags = list(
|
|
|
self.ts.get_release_tags(self.proj1.organization_id, [self.proj1.id], None, ["100"])
|