Skip to content

Commit 92a9333

Browse files
committed
Cover a bundle entry naming a source on another system
1 parent ad8f250 commit 92a9333

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎tests/services/fhir/test_bundle_service.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,20 @@ def test_denies_a_post_naming_another_source(
548548
assert result.response.status == "403"
549549
assert service.calls == []
550550

551+
def test_rejects_a_post_naming_a_source_on_another_system(
552+
self,
553+
bundle_service: BundleService,
554+
service: LocalizationListServiceSpy,
555+
) -> None:
556+
resource = make_list_resource()
557+
resource.source.identifier.system = "urn:wrong"
558+
559+
result = process(bundle_service, make_entry("POST", "List", resource), [AuthorizationScope.CREATE])
560+
561+
assert result.response is not None
562+
assert result.response.status == "400"
563+
assert service.calls == []
564+
551565
def test_allows_a_post_naming_the_callers_own_source(
552566
self,
553567
bundle_service: BundleService,

0 commit comments

Comments
 (0)