fixed tests to work in batch mode

This commit is contained in:
smilerz
2021-04-11 22:05:27 -05:00
parent 35a7f62837
commit b37fc4e24f
5 changed files with 13 additions and 6 deletions

View File

@ -77,7 +77,8 @@ def test_add(arg, request, u1_s2):
print(r.content)
assert r.status_code == arg[1]
if r.status_code == 201:
assert response['id'] == 1
# ids can change when running multiple tests - changed assert to instruction
assert response['instruction'] == 'test'
r = c.get(reverse(DETAIL_URL, args={response['id']}))
assert r.status_code == 404 # ingredient is not linked to a recipe and therefore cannot be accessed
r = u1_s2.get(reverse(DETAIL_URL, args={response['id']}))