Bugzilla – Attachment 122459 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.30 KB, created by
David Nind
on 2021-06-25 23:32:43 UTC
(
hide
)
Description:
Bug 28585: (follow-up) Tests for q= supporting date/date-time parameters
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-06-25 23:32:43 UTC
Size:
2.30 KB
patch
obsolete
>From 74c679cd0fa9f81b95ecf0e64c3006252f96586a 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> >--- > 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 78ec764422..441120f23a 100755 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -33,6 +33,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; > >@@ -87,7 +89,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'; >@@ -111,6 +113,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