added Credential.migrate_to_rbac and tests

This commit is contained in:
Wayne Witzel III
2016-02-05 08:47:15 -05:00
parent b903726ddb
commit 58a603bac1
3 changed files with 73 additions and 8 deletions
+16 -1
View File
@@ -1,6 +1,10 @@
import pytest
from awx.main.models.organization import Organization
from awx.main.models.credential import Credential
from awx.main.models.organization import (
Organization,
Team,
)
from django.contrib.auth.models import User
@pytest.fixture
@@ -14,10 +18,18 @@ def user():
return user
return u
@pytest.fixture
def team(organization):
return Team.objects.create(organization=organization, name='test-team')
@pytest.fixture
def organization():
return Organization.objects.create(name="test-org", description="test-org-desc")
@pytest.fixture
def credential():
return Credential.objects.create(kind='aws', name='test-cred')
@pytest.fixture
def permissions():
return {
@@ -26,5 +38,8 @@ def permissions():
'auditor':{'read':True, 'create':False, 'write':False,
'update':False, 'delete':False, 'scm_update':False, 'execute':False, 'use':False,},
'usage':{'read':False, 'create':False, 'write':False,
'update':False, 'delete':False, 'scm_update':False, 'execute':False, 'use':True,},
}