Skip to content

Commit

Permalink
Add custom_injectors to test code path
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
chrismeyersfsu committed Dec 10, 2024
1 parent 1d255f3 commit 8d57cd3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion awx/main/models/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,9 @@ def get_creation_params(self):
)

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):
Expand Down

0 comments on commit 8d57cd3

Please sign in to comment.