Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
flipbit03 committed Aug 27, 2023
1 parent cd5f207 commit 7a0365f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __repr__(self):
class SoftDeleteMixin(
generate_soft_delete_mixin_class(
ignored_tables=[
IgnoredTable(table_schema=None, name='sdclassthatshouldnotbesoftdeleted'),
IgnoredTable(table_schema=None, name='sdtablethatshouldnotbesoftdeleted'),
],
)
):
Expand Down
3 changes: 2 additions & 1 deletion tests/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def is_simple_select_doing_soft_delete_filtering(stmt: Select, tables: set[Table
return True

# if we don't have a where clause, we can't be filtering for soft-deleted
if not stmt.whereclause:
# Caveat: We need to compare with None, since and whereclause usually does not have a __bool__ method
if stmt.whereclause is None:
return False

binary_expressions = extract_binary_expressions_from_where(stmt.whereclause)
Expand Down

0 comments on commit 7a0365f

Please sign in to comment.