mirror of
https://github.com/ansible/awx.git
synced 2026-05-01 22:55:28 -02:30
Introduce sso UserEnterpriseAuth model.
This commit is contained in:
@@ -3,6 +3,7 @@ import pytest
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from awx.sso.backends import TACACSPlusBackend
|
||||
from awx.sso.models import UserEnterpriseAuth
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -10,6 +11,16 @@ def tacacsplus_backend():
|
||||
return TACACSPlusBackend()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def existing_normal_user():
|
||||
try:
|
||||
user = User.objects.get(username="alice")
|
||||
except User.DoesNotExist:
|
||||
user = User(username="alice", password="password")
|
||||
user.save()
|
||||
return user
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def existing_tacacsplus_user():
|
||||
try:
|
||||
@@ -17,6 +28,8 @@ def existing_tacacsplus_user():
|
||||
except User.DoesNotExist:
|
||||
user = User(username="foo")
|
||||
user.save()
|
||||
enterprise_auth = UserEnterpriseAuth(user=user, provider='tacacs+')
|
||||
enterprise_auth.save()
|
||||
return user
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user