tests: don't use resp.json() as it was not available in django 1.8

This commit is contained in:
Frédéric Péters 2018-12-28 13:38:42 +01:00
parent fcd1a6115b
commit 0257b17ac9
1 changed files with 6 additions and 6 deletions

View File

@ -191,18 +191,18 @@ def test_notification_ws(john_doe):
resp = client.get(reverse('api-notification-count'))
assert resp.status_code == 200
assert resp.json()['new'] == 3
assert resp.json()['total'] == 3
assert json.loads(resp.content)['new'] == 3
assert json.loads(resp.content)['total'] == 3
resp = client.get(reverse('api-notification-ack', kwargs={'notification_id': '1'}))
resp = client.get(reverse('api-notification-count'))
assert resp.status_code == 200
assert resp.json()['new'] == 2
assert resp.json()['total'] == 3
assert json.loads(resp.content)['new'] == 2
assert json.loads(resp.content)['total'] == 3
resp = client.get(reverse('api-notification-forget', kwargs={'notification_id': '1'}))
resp = client.get(reverse('api-notification-count'))
assert resp.status_code == 200
assert resp.json()['new'] == 2
assert resp.json()['total'] == 2
assert json.loads(resp.content)['new'] == 2
assert json.loads(resp.content)['total'] == 2
def test_notification_ws_badrequest(john_doe):