def METHOD_NAME(run_module, admin_user, organization):
    Organization.objects.create(name='test-org')
    # create the ssh credential type
    ct = CredentialType.defaults['ssh']()
    ct.save()
    # Example from docs
    result = run_module(
        'credential',
        dict(name='Test Machine Credential',
             organization=organization.name,
             credential_type='Machine',
             state='present'),
        admin_user,
    )
    assert not result.get('failed', False), result.get('msg', result)
    assert result.get('changed'), result
    cred = Credential.objects.get(name='Test Machine Credential')
    assert cred.credential_type == ct
    assert result['name'] == "Test Machine Credential"
    assert result['id'] == cred.pk