From 57c18a56238a5ec263fefac797734240877378c3 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Tue, 8 Oct 2024 15:51:14 +0200 Subject: [PATCH] Fixed unit test --- test/async_/test_match_api.py | 6 +++--- test/sync_/test_match_api.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/async_/test_match_api.py b/test/async_/test_match_api.py index 1d90b625..09b3a3e8 100644 --- a/test/async_/test_match_api.py +++ b/test/async_/test_match_api.py @@ -287,8 +287,8 @@ async def test_contains(): @mark_async_test async def test_order_by(): - for c in await Coffee.nodes: - await c.delete() + # Clean DB before we start anything... + await adb.cypher_query("MATCH (n) DETACH DELETE n") c1 = await Coffee(name="Icelands finest", price=5).save() c2 = await Coffee(name="Britains finest", price=10).save() @@ -316,7 +316,7 @@ async def test_order_by(): ValueError, match=r".*Neo4j internals like id or element_id are not allowed for use in this operation.", ): - await Coffee.nodes.order_by("id") + await Coffee.nodes.order_by("id").all() # Test order by on a relationship l = await Supplier(name="lidl2").save() diff --git a/test/sync_/test_match_api.py b/test/sync_/test_match_api.py index f9beafa6..942b8482 100644 --- a/test/sync_/test_match_api.py +++ b/test/sync_/test_match_api.py @@ -283,8 +283,8 @@ def test_contains(): @mark_sync_test def test_order_by(): - for c in Coffee.nodes: - c.delete() + # Clean DB before we start anything... + db.cypher_query("MATCH (n) DETACH DELETE n") c1 = Coffee(name="Icelands finest", price=5).save() c2 = Coffee(name="Britains finest", price=10).save() @@ -312,7 +312,7 @@ def test_order_by(): ValueError, match=r".*Neo4j internals like id or element_id are not allowed for use in this operation.", ): - Coffee.nodes.order_by("id") + Coffee.nodes.order_by("id").all() # Test order by on a relationship l = Supplier(name="lidl2").save()