Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LITE-30338: Adding new search patterns that are now supported by lib-rql. Bumping rql-lib. #78

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions tests/test_filter_cls/test_apply_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,3 +689,25 @@ def test_distinct_on_field_field_in_ordering():
def test_distinct_on_field_field_not_in_ordering():
_, qs = BooksFilterClass(book_qs).apply_filters('ordering(int_choice_field)')
assert not qs.query.distinct


@pytest.mark.django_db
@pytest.mark.parametrize(
'query',
(
'(not(ilike(title,*ermat*)))',
'(not(ilike(title,*ermat*))&not(ilike(author__name,*Foo*)))',
'(and(not(ilike(title,*ermat*)),not(ilike(author__name,*Foo*))))',
),
)
def test_complex_nested_queries(query):
publisher = [Publisher.objects.create() for _ in range(2)]

author = Author.objects.create(name='Foo', publisher=publisher[0], is_male=False)
Book.objects.create(amazon_rating=4.0, author=author, title='Fermats last theorem')

other_author = Author.objects.create(name='Bar', publisher=publisher[0], is_male=False)
other_book = Book.objects.create(amazon_rating=4.5, author=other_author, title="Madame Bovary")
other_book2 = Book.objects.create(amazon_rating=4.5, author=other_author, title="Madame Bovary")

assert apply_filters(query) == [other_book, other_book2]
Loading