mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 23:46:05 -03:30
include password when creating new user
This commit is contained in:
@@ -286,7 +286,7 @@ class OrganizationsTest(BaseTest):
|
|||||||
self.assertEqual(users['count'], 2)
|
self.assertEqual(users['count'], 2)
|
||||||
|
|
||||||
# post a completely new user to verify we can add users to the subcollection directly
|
# post a completely new user to verify we can add users to the subcollection directly
|
||||||
new_user = dict(username='NewUser9000')
|
new_user = dict(username='NewUser9000', password='NewPassword9000')
|
||||||
which_org = self.normal_django_user.admin_of_organizations.all()[0]
|
which_org = self.normal_django_user.admin_of_organizations.all()[0]
|
||||||
url = reverse('api:organization_users_list', args=(which_org.pk,))
|
url = reverse('api:organization_users_list', args=(which_org.pk,))
|
||||||
self.post(url, new_user, expect=201, auth=self.get_normal_credentials())
|
self.post(url, new_user, expect=201, auth=self.get_normal_credentials())
|
||||||
|
|||||||
@@ -419,11 +419,11 @@ class ProjectsTest(BaseTransactionTest):
|
|||||||
self.post(team_users, data=dict(x, is_superuser=False),
|
self.post(team_users, data=dict(x, is_superuser=False),
|
||||||
expect=204, auth=self.get_normal_credentials())
|
expect=204, auth=self.get_normal_credentials())
|
||||||
# The normal admin user can't create a super user vicariously through the team/project
|
# The normal admin user can't create a super user vicariously through the team/project
|
||||||
self.post(team_users, data=dict(username='attempted_superuser_create', is_superuser=True),
|
self.post(team_users, data=dict(username='attempted_superuser_create', password='thepassword',
|
||||||
expect=403, auth=self.get_normal_credentials())
|
is_superuser=True), expect=403, auth=self.get_normal_credentials())
|
||||||
# ... but a superuser can
|
# ... but a superuser can
|
||||||
self.post(team_users, data=dict(username='attempted_superuser_create', is_superuser=True),
|
self.post(team_users, data=dict(username='attempted_superuser_create', password='thepassword',
|
||||||
expect=201, auth=self.get_super_credentials())
|
is_superuser=True), expect=201, auth=self.get_super_credentials())
|
||||||
|
|
||||||
self.assertEqual(Team.objects.get(pk=team.pk).users.count(), 5)
|
self.assertEqual(Team.objects.get(pk=team.pk).users.count(), 5)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user