Skip to content

Commit 4e49188

Browse files
romtsnclaude
andcommitted
fix(code-mappings): Fix derive code mappings test for new unique constraint
Update test_post_existing_code_mapping to assert both mappings coexist when stack_root matches but source_root differs, matching the new (project, stack_root, source_root) unique constraint. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f7f201a commit 4e49188

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/sentry/api/endpoints/issues/test_organization_derive_code_mappings.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,12 @@ def test_post_existing_code_mapping(self) -> None:
321321
response = self.client.post(self.url, data=config_data, format="json")
322322
assert response.status_code == 201, response.content
323323

324-
new_code_mapping = RepositoryProjectPathConfig.objects.get(
324+
# Both mappings should coexist: the original and the newly derived one
325+
mappings = RepositoryProjectPathConfig.objects.filter(
325326
project=self.project, stack_root="/stack/root"
326327
)
327-
assert new_code_mapping.source_root == "/source/root"
328+
assert mappings.count() == 2
329+
assert set(mappings.values_list("source_root", flat=True)) == {
330+
"/source/root/wrong",
331+
"/source/root",
332+
}

0 commit comments

Comments
 (0)