Bugzilla – Attachment 126670 Details for
Bug 28585
Cannot search on date fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28585: (follow-up) Tests for q= supporting date/date-time parameters
Bug-28585-follow-up-Tests-for-q-supporting-datedat.patch (text/plain), 2.42 KB, created by
Martin Renvoize (ashimema)
on 2021-10-21 15:18:55 UTC
(
hide
)
Description:
Bug 28585: (follow-up) Tests for q= supporting date/date-time parameters
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-21 15:18:55 UTC
Size:
2.42 KB
patch
obsolete
>From 327fd5ac93f58d92112dd723acd76fc9031a4b18 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 25 Jun 2021 11:49:06 -0300 >Subject: [PATCH] Bug 28585: (follow-up) Tests for q= supporting date/date-time > parameters > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/api/v1/patrons.t | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t >index 8d092a8954..d8dc2ff608 100755 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -34,6 +34,8 @@ use Koha::Exceptions::Patron::Attribute; > use Koha::Patron::Attributes; > use Koha::Patron::Debarments qw/AddDebarment/; > >+use JSON qw(encode_json); >+ > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; > >@@ -88,7 +90,7 @@ subtest 'list() tests' => sub { > > subtest 'searching date and date-time fields' => sub { > >- plan tests => 6; >+ plan tests => 12; > > my $date_of_birth = '1980-06-18'; > my $last_seen = '2021-06-25 14:05:35'; >@@ -112,6 +114,28 @@ subtest 'list() tests' => sub { > $t->get_ok("//$userid:$password@/api/v1/patrons?last_seen=" . $last_seen_rfc3339 . "&cardnumber=" . $patron->cardnumber) > ->status_is(200) > ->json_is( '/0/patron_id' => $patron->id, 'Filtering by date-time works' ); >+ >+ my $q = encode_json( >+ { >+ date_of_birth => $date_of_birth, >+ cardnumber => $patron->cardnumber, >+ } >+ ); >+ >+ $t->get_ok("//$userid:$password@/api/v1/patrons?q=$q") >+ ->status_is(200) >+ ->json_is( '/0/patron_id' => $patron->id, 'Filtering by date works' ); >+ >+ $q = encode_json( >+ { >+ last_seen => $last_seen_rfc3339, >+ cardnumber => $patron->cardnumber, >+ } >+ ); >+ >+ $t->get_ok("//$userid:$password@/api/v1/patrons?q=$q") >+ ->status_is(200) >+ ->json_is( '/0/patron_id' => $patron->id, 'Filtering by date-time works' ); > }; > > $schema->storage->txn_rollback; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28585
:
122381
|
122444
|
122445
|
122446
|
122457
|
122458
|
122459
|
123115
|
123116
|
123117
|
126668
|
126669
| 126670 |
126671
|
126679