From c82a8f4b9ce0ea4717f101ccbbd5204e48645888 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 19 Nov 2024 16:06:11 -0500 Subject: Add custom_injectors to test code path * Unit tests do not create CredentialType records for Credential plugins. Instead, they explicitly instantiate CredentialType(s) for Credential plugins. They rely on CredentialType.defaults[key] to do so. This change makes sure custom_injectors get bolted onto the created CredentialType. --- awx/main/models/credential.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/main/models/credential.py b/awx/main/models/credential.py index 8df80239c4..e3d67404f1 100644 --- a/awx/main/models/credential.py +++ b/awx/main/models/credential.py @@ -710,7 +710,9 @@ class ManagedCredentialType(SimpleNamespace): ) def create(self): - return CredentialType(**self.get_creation_params()) + res = CredentialType(**self.get_creation_params()) + res.custom_injectors = self.custom_injectors + return res class CredentialInputSource(PrimordialModel): -- cgit v1.2.3