Skip to content

Commit

Permalink
passing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nilbacardit26 committed Oct 22, 2024
1 parent 049764c commit d2bee16
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions guillotina_audit/tests/test_audit_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,23 @@ async def test_audit_basic(guillotina_es):
)
assert status == 201
await asyncio.sleep(2)
resp, status = await guillotina_es("GET", "/db/guillotina/@audit")
resp, status = await guillotina_es(
"GET", "/db/guillotina/@audit?type_name=Container"
)
assert status == 200
assert len(resp["hits"]["hits"]) == 2
assert len(resp["hits"]["hits"]) == 1
assert resp["hits"]["hits"][0]["_source"]["action"] == "added"
assert resp["hits"]["hits"][0]["_source"]["type_name"] == "Container"
assert resp["hits"]["hits"][0]["_source"]["creator"] == "root"
assert "title" in resp["hits"]["hits"][0]["_source"]["payload"]

assert resp["hits"]["hits"][1]["_source"]["action"] == "added"
assert resp["hits"]["hits"][1]["_source"]["type_name"] == "Item"
assert resp["hits"]["hits"][1]["_source"]["creator"] == "root"
assert "title" in resp["hits"]["hits"][1]["_source"]["payload"]
resp, status = await guillotina_es("GET", "/db/guillotina/@audit?type_name=Item")
assert status == 200

assert resp["hits"]["hits"][0]["_source"]["action"] == "added"
assert resp["hits"]["hits"][0]["_source"]["type_name"] == "Item"
assert resp["hits"]["hits"][0]["_source"]["creator"] == "root"
assert "title" in resp["hits"]["hits"][0]["_source"]["payload"]

response, status = await guillotina_es("DELETE", "/db/guillotina/foo_item")
await asyncio.sleep(2)
Expand Down

0 comments on commit d2bee16

Please sign in to comment.