From dc25e044f00ff03340cea970cec3eb75768d12ba Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Tue, 8 Jul 2025 15:06:20 +0200 Subject: [PATCH] Add store_tags test for 2 separate Issues (there were some doubts whether this works; this test takes those doubts away) --- tags/tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tags/tests.py b/tags/tests.py index b124b1e..703ea39 100644 --- a/tags/tests.py +++ b/tags/tests.py @@ -119,6 +119,16 @@ class StoreTagsTestCase(DjangoTestCase): self.assertEqual(self.issue.tags.first().count, 2) self.assertEqual(self.issue.tags.first().value.key.key, "foo") + def test_store_same_tag_on_two_issues_creates_two_issuetags(self): + store_tags(self.event, self.issue, {"foo": "bar"}) + + other_issue, _ = get_or_create_issue(self.project, event_data=create_event_data("other_issue")) + other_event = create_event(self.project, issue=other_issue) + store_tags(other_event, other_issue, {"foo": "bar"}) + + self.assertEqual(IssueTag.objects.count(), 2) + self.assertEqual(2, IssueTag.objects.filter(value__key__key="foo").count()) + class SearchParserTestCase(RegularTestCase):