cartads cs/tests: parse response json instead of checking string value

This commit is contained in:
Frédéric Péters 2019-10-15 10:58:01 +02:00
parent 5070746b0d
commit 2d0cc69af0
1 changed files with 2 additions and 1 deletions

View File

@ -646,7 +646,8 @@ def test_role_sync(connector, app, cached_data):
assert url.netloc == 'idp.example.org'
if url.path == '/api/roles/':
dossier = CartaDSDossier.objects.all().first()
assert request.body == '{"name": "Suivi Cart@DS (%s)", "slug": "_cartads_%s"}' % (dossier.id, dossier.id)
assert json.loads(request.body) == json.loads(
'{"name": "Suivi Cart@DS (%s)", "slug": "_cartads_%s"}' % (dossier.id, dossier.id))
return {'content': json.dumps({'uuid': 'role-uuid'}), 'status_code': 200}
elif url.path == '/api/roles/role-uuid/relationships/members/':
body = json.loads(request.body)