tests: fix test on role creation (#34704)

This commit is contained in:
Benjamin Dauvergne 2019-07-09 20:14:05 +02:00
parent f7e5f2a700
commit 3bb74a68e8
1 changed files with 2 additions and 1 deletions

View File

@ -1230,7 +1230,7 @@ def test_api_roles_get_or_create(settings, ou1, app, admin):
app.authorization = ('Basic', (admin.username, admin.username))
# test missing first_name
payload = {
'ou_slug': 'ou1',
'ou': 'ou1',
'name': 'Role 1',
'slug': 'role-1',
}
@ -1238,6 +1238,7 @@ def test_api_roles_get_or_create(settings, ou1, app, admin):
uuid = resp.json['uuid']
assert Role.objects.get(uuid=uuid).name == 'Role 1'
assert Role.objects.get(uuid=uuid).slug == 'role-1'
assert Role.objects.get(uuid=uuid).ou == ou1
resp = app.post_json('/api/roles/?get_or_create=slug', params=payload, status=201)
assert uuid == resp.json['uuid']