diff --git a/tests/test_name_properties.py b/tests/test_name_properties.py
index 30bcac9807290358cb7133ba7490ce128e0a703e..028592b7c0a728587f9939e427eb40ba74b9be43 100644
--- a/tests/test_name_properties.py
+++ b/tests/test_name_properties.py
@@ -221,9 +221,8 @@ def test_query_name_property():
 
     assert db.execute_query("FIND TestPerson WITH TestGivenName='John'",
                             unique=True).id == rec.id
-    with raises(db.TransactionError) as te:
+    with raises(db.BadQueryError):
         db.execute_query("FIND John", unique=True)
-    assert te.value.has_error(db.EntityDoesNotExistError)
 
     teardown()