Bugzilla – Attachment 126671 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: (QA follow-up) Fix object.t
Bug-28585-QA-follow-up-Fix-objectt.patch (text/plain), 2.95 KB, created by
Martin Renvoize (ashimema)
on 2021-10-21 15:19:00 UTC
(
hide
)
Description:
Bug 28585: (QA follow-up) Fix object.t
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-21 15:19:00 UTC
Size:
2.95 KB
patch
obsolete
>From 5f172fa95293477ce9979f1a0bba889fba02f7f7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 21 Oct 2021 16:08:19 +0100 >Subject: [PATCH] Bug 28585: (QA follow-up) Fix object.t > >Object.t was still testing for the return of DateTime objects from >attributes_from_api. I checked all calls to attrbutes_from_api for >reliance of DateTime objects and confirmed they all get passed into >search calls and thus are better served as SQL formatted strings. > >I then converted the test to check that the rfc3339 formatted dates >passed in were converted to strings appropriate for feeding into SQL >where statements instead. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Object.t | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index 8004c26446..8a034a36b0 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -530,8 +530,8 @@ subtest 'attributes_from_api() tests' => sub { > > my $attrs = $patron->attributes_from_api( > { >- updated_on => '2019-12-27T14:53:00', >- last_seen => '2019-12-27T14:53:00', >+ updated_on => '2019-12-27T14:53:00Z', >+ last_seen => '2019-12-27T14:53:00Z', > date_of_birth => '2019-12-27', > } > ); >@@ -539,25 +539,25 @@ subtest 'attributes_from_api() tests' => sub { > ok( exists $attrs->{updated_on}, > 'No translation takes place if no mapping' ); > is( >- ref( $attrs->{updated_on} ), >- 'DateTime', >- 'Given a string, a timestamp field is converted into a DateTime object' >+ $attrs->{updated_on}, >+ '2019-12-27 14:53:00', >+ 'Given an rfc3339 formatted datetime string, a timestamp field is converted into an SQL formatted datetime string' > ); > > ok( exists $attrs->{lastseen}, > 'Translation takes place because of the defined mapping' ); > is( >- ref( $attrs->{lastseen} ), >- 'DateTime', >- 'Given a string, a datetime field is converted into a DateTime object' >+ $attrs->{lastseen}, >+ '2019-12-27 14:53:00', >+ 'Given an rfc3339 formatted datetime string, a datetime field is converted into an SQL formatted datetime string' > ); > > ok( exists $attrs->{dateofbirth}, > 'Translation takes place because of the defined mapping' ); > is( >- ref( $attrs->{dateofbirth} ), >- 'DateTime', >- 'Given a string, a date field is converted into a DateTime object' >+ $attrs->{dateofbirth}, >+ '2019-12-27', >+ 'Given an rfc3339 formated date string, a date field is converted into an SQL formatted date string' > ); > > $attrs = $patron->attributes_from_api( >-- >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