Skip to content

Commit cd9bfd6

Browse files
committed
Add test for render_tree (test that pptree is not needed)
1 parent ceb2e0a commit cd9bfd6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_json_model.py

+13
Original file line numberDiff line numberDiff line change
@@ -776,3 +776,16 @@ async def test_schema(m, key_prefix):
776776
m.Member.redisearch_schema()
777777
== f"ON JSON PREFIX 1 {key_prefix} SCHEMA $.pk AS pk TAG SEPARATOR | $.first_name AS first_name TAG SEPARATOR | $.last_name AS last_name TAG SEPARATOR | $.email AS email TAG SEPARATOR | $.age AS age NUMERIC $.bio AS bio TAG SEPARATOR | $.bio AS bio_fts TEXT $.address.pk AS address_pk TAG SEPARATOR | $.address.city AS address_city TAG SEPARATOR | $.address.postal_code AS address_postal_code TAG SEPARATOR | $.address.note.pk AS address_note_pk TAG SEPARATOR | $.address.note.description AS address_note_description TAG SEPARATOR | $.orders[*].pk AS orders_pk TAG SEPARATOR | $.orders[*].items[*].pk AS orders_items_pk TAG SEPARATOR | $.orders[*].items[*].name AS orders_items_name TAG SEPARATOR |"
778778
)
779+
780+
781+
# TODO: move to common test file
782+
def test_render_no_fail(m):
783+
expression = (
784+
((m.Member.first_name == "Test") & (m.Member.join_date < today))
785+
& ((m.Member.age > 25) | (m.Member.bio % "degree"))
786+
& (
787+
~(m.Member.address.city != "London")
788+
| (m.Member.address.postal_code > 9876543)
789+
)
790+
)
791+
_s = expression.tree # noqa: F841

0 commit comments

Comments
 (0)