From 7001ec60df8d1f70b689860427937860988885f3 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Mon, 7 Mar 2022 18:57:09 -0100 Subject: [PATCH] Reduce duplicate matches - ensures compatibility Responses 0.19.0 (#4914) --- moto/core/responses_custom_registry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/moto/core/responses_custom_registry.py b/moto/core/responses_custom_registry.py index 097d14139..2e87dd6ab 100644 --- a/moto/core/responses_custom_registry.py +++ b/moto/core/responses_custom_registry.py @@ -10,6 +10,10 @@ class CustomRegistry(responses.registries.FirstMatchRegistry): - CallbackResponses are not discarded after first use - users can mock the same URL as often as they like """ + def add(self, response): + if response not in self.registered: + super().add(response) + def find(self, request): all_possibles = responses._default_mock._registry.registered + self.registered found = []