Skip to content

Commit 625e790

Browse files
committed
Fix some tests
1 parent c2e6b51 commit 625e790

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

cassandra/cqlengine/query.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,8 +1076,9 @@ def _validate_select_where(self):
10761076
# custom indexes to be queried with any operator (a difference
10771077
# between a secondary index)
10781078
equal_ops = [self.model._get_column_by_db_name(w.field) \
1079-
for w in self._where if (isinstance(w.operator, EqualsOperator) and not isinstance(w.value, Token))
1080-
or self.model._get_column_by_db_name(w.field).custom_index]
1079+
for w in self._where if not isinstance(w.value, Token)
1080+
and (isinstance(w.operator, EqualsOperator)
1081+
or self.model._get_column_by_db_name(w.field).custom_index)]
10811082
token_comparison = any([w for w in self._where if isinstance(w.value, Token)])
10821083
if not any(w.primary_key or w.has_index for w in equal_ops) and not token_comparison and not self._allow_filtering:
10831084
raise QueryException(

tests/integration/cqlengine/test_connections.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ def setUpClass(cls):
536536
conn.register_connection('cluster', [CASSANDRA_IP])
537537
test_queryset.TestModel.__queryset__ = ModelQuerySetNew
538538
test_queryset.IndexedTestModel.__queryset__ = ModelQuerySetNew
539+
test_queryset.CustomIndexedTestModel.__queryset__ = ModelQuerySetNew
539540
test_queryset.IndexedCollectionsTestModel.__queryset__ = ModelQuerySetNew
540541
test_queryset.TestMultiClusteringModel.__queryset__ = ModelQuerySetNew
541542

0 commit comments

Comments
 (0)