File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,27 @@ def test_query_order_jpql_function(client):
463
463
assert res [0 ].fullName == "Nicolas Bourbaki"
464
464
verify_rebuild_query (client , query , res )
465
465
466
+ def test_query_order_attribute_multiple (client ):
467
+ """Add the same attribute more than once to the order.
468
+
469
+ The restriction that any attribute may only be added once to the
470
+ order has been removed in #158.
471
+ """
472
+ query = Query (client , 'User' , order = [
473
+ ('LENGTH(fullName)' , 'DESC' ),
474
+ ('fullName' , 'DESC' ),
475
+ ])
476
+ print (str (query ))
477
+ assert "User" in query .select_clause
478
+ assert query .join_clause is None
479
+ assert query .where_clause is None
480
+ assert query .order_clause .count ("fullName" ) == 2
481
+ assert "LENGTH" in query .order_clause
482
+ res = client .search (query )
483
+ assert len (res ) > 4
484
+ assert res [4 ].fullName == "Aelius Cordus"
485
+ verify_rebuild_query (client , query , res )
486
+
466
487
def test_query_rule_order (client ):
467
488
"""Rule does not have a constraint, id is included in the natural order.
468
489
"""
You can’t perform that action at this time.
0 commit comments