summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Meyers <chris.meyers.fsu@gmail.com>2024-11-19 22:06:11 +0100
committerChris Meyers <chrismeyersfsu@users.noreply.github.com>2024-12-10 19:02:09 +0100
commitc82a8f4b9ce0ea4717f101ccbbd5204e48645888 (patch)
treee60ec673297486304158e2d1f8c113fb36b0e115
parentLoad all plugins in order to test them (diff)
downloadawx-c82a8f4b9ce0ea4717f101ccbbd5204e48645888.tar.xz
awx-c82a8f4b9ce0ea4717f101ccbbd5204e48645888.zip
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.
-rw-r--r--awx/main/models/credential.py4
1 files changed, 3 insertions, 1 deletions
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):