misc: add ilike operator (#74026) #1088

Merged
fpeters merged 1 commits from wip/74026-like-operator into main 2024-03-15 07:22:01 +01:00
Owner
No description provided.
fpeters added 1 commit 2024-02-01 11:43:21 +01:00
gitea/wcs/pipeline/head There was a failure building this commit Details
5c77a7c97f
misc: add ilike operator (#74026)
fpeters force-pushed wip/74026-like-operator from 5c77a7c97f to f827071939 2024-02-09 11:05:43 +01:00 Compare
fpeters force-pushed wip/74026-like-operator from f827071939 to 686889c371 2024-02-09 11:11:41 +01:00 Compare
fpeters force-pushed wip/74026-like-operator from 686889c371 to 964bacfeb7 2024-02-09 11:18:26 +01:00 Compare
fpeters force-pushed wip/74026-like-operator from 964bacfeb7 to 8afb4c6a91 2024-02-09 16:57:32 +01:00 Compare
fpeters changed title from WIP: misc: add ilike operator (#74026) to misc: add ilike operator (#74026) 2024-02-23 21:27:28 +01:00
fpeters force-pushed wip/74026-like-operator from 8afb4c6a91 to d09d34d96b 2024-03-01 13:22:04 +01:00 Compare
Author
Owner

J'ai zappé d'en faire un commit à part, je viens d'ajouter ces tests :

diff --git a/tests/api/test_formdata.py b/tests/api/test_formdata.py
index 5178e9f20..9d4a691d0 100644
--- a/tests/api/test_formdata.py
+++ b/tests/api/test_formdata.py
@@ -1544,6 +1544,9 @@ def test_api_list_formdata_text_filter(pub, local_user):
         ('existing', 'on', 3),
         ('between', 'FOO 1|FOO 2', 1),
         ('between', 'FOO 2|FOO 1', 1),
+        ('icontains', 'FOO', 3),
+        ('icontains', 'foo', 3),
+        ('icontains', '2', 1),
     ]
     for operator, value, result in params:
         resp = get_app(pub).get(
@@ -2013,6 +2016,8 @@ def test_api_list_formdata_email_filter(pub, local_user):
         ('not_in', 'a@localhost|b@localhost', 1),
         ('absent', 'on', 2),
         ('existing', 'on', 3),
+        ('icontains', 'A@LOCAL', 1),
+        ('icontains', 'C@LOCAL', 0),
     ]
     for operator, value, result in params:
         resp = get_app(pub).get(
@@ -2309,6 +2314,8 @@ def test_api_list_formdata_block_field_filter(pub, local_user):
         ('existing', 'on', 12),
         ('between', 'plop1|plop5', 7),
         ('between', 'plop5|plop1', 7),
+        ('icontains', 'PLOP', 12),
+        ('icontains', 'LOP1', 4),  # plop1 (twice), plop10, plop11
     ]
     for operator, value, result in params:
         resp = get_app(pub).get(
diff --git a/tests/test_formdata.py b/tests/test_formdata.py
index 1af67797e..2fbc8e02f 100644
--- a/tests/test_formdata.py
+++ b/tests/test_formdata.py
@@ -4496,6 +4496,8 @@ def test_formdata_filtering_on_fields(pub):
         ('not_in', 'a@localhost|b@localhost', '1'),
         ('absent', '', '2'),
         ('existing', '', '10'),
+        ('icontains', 'A@local', '5'),
+        ('icontains', '@LOCAL', '10'),
     ]
     for operator, value, result in params:
         if value:
@@ -4545,6 +4547,8 @@ def test_formdata_filtering_on_fields(pub):
         ('between', 'plop5|plop1', '4'),
         ('between', ['plop1', 'plop5'], '4'),
         ('between', ['plop5', 'plop1'], '4'),
+        ('icontains', 'plop', '10'),
+        ('icontains', 'PLOP', '10'),
     ]
     for operator, value, result in params:
         context['value'] = None
J'ai zappé d'en faire un commit à part, je viens d'ajouter ces tests : ``` diff --git a/tests/api/test_formdata.py b/tests/api/test_formdata.py index 5178e9f20..9d4a691d0 100644 --- a/tests/api/test_formdata.py +++ b/tests/api/test_formdata.py @@ -1544,6 +1544,9 @@ def test_api_list_formdata_text_filter(pub, local_user): ('existing', 'on', 3), ('between', 'FOO 1|FOO 2', 1), ('between', 'FOO 2|FOO 1', 1), + ('icontains', 'FOO', 3), + ('icontains', 'foo', 3), + ('icontains', '2', 1), ] for operator, value, result in params: resp = get_app(pub).get( @@ -2013,6 +2016,8 @@ def test_api_list_formdata_email_filter(pub, local_user): ('not_in', 'a@localhost|b@localhost', 1), ('absent', 'on', 2), ('existing', 'on', 3), + ('icontains', 'A@LOCAL', 1), + ('icontains', 'C@LOCAL', 0), ] for operator, value, result in params: resp = get_app(pub).get( @@ -2309,6 +2314,8 @@ def test_api_list_formdata_block_field_filter(pub, local_user): ('existing', 'on', 12), ('between', 'plop1|plop5', 7), ('between', 'plop5|plop1', 7), + ('icontains', 'PLOP', 12), + ('icontains', 'LOP1', 4), # plop1 (twice), plop10, plop11 ] for operator, value, result in params: resp = get_app(pub).get( diff --git a/tests/test_formdata.py b/tests/test_formdata.py index 1af67797e..2fbc8e02f 100644 --- a/tests/test_formdata.py +++ b/tests/test_formdata.py @@ -4496,6 +4496,8 @@ def test_formdata_filtering_on_fields(pub): ('not_in', 'a@localhost|b@localhost', '1'), ('absent', '', '2'), ('existing', '', '10'), + ('icontains', 'A@local', '5'), + ('icontains', '@LOCAL', '10'), ] for operator, value, result in params: if value: @@ -4545,6 +4547,8 @@ def test_formdata_filtering_on_fields(pub): ('between', 'plop5|plop1', '4'), ('between', ['plop1', 'plop5'], '4'), ('between', ['plop5', 'plop1'], '4'), + ('icontains', 'plop', '10'), + ('icontains', 'PLOP', '10'), ] for operator, value, result in params: context['value'] = None ```
lguerin approved these changes 2024-03-04 10:04:41 +01:00
fpeters merged commit ea20e7bcac into main 2024-03-15 07:22:01 +01:00
fpeters deleted branch wip/74026-like-operator 2024-03-15 07:22:01 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: entrouvert/wcs#1088
No description provided.