Bugzilla – Attachment 175671 Details for
Bug 38678
GET /deleted/biblios cannot be filtered on `deleted_on`
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38678: Regression tests
Bug-38678-Regression-tests.patch (text/plain), 2.20 KB, created by
David Nind
on 2024-12-18 19:27:31 UTC
(
hide
)
Description:
Bug 38678: Regression tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-12-18 19:27:31 UTC
Size:
2.20 KB
patch
obsolete
>From 3d861d7ce565dca6db1f070cf6a13782794f98f8 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 11 Dec 2024 14:09:28 -0300 >Subject: [PATCH] Bug 38678: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/api/v1/deleted_biblios.t | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/deleted_biblios.t b/t/db_dependent/api/v1/deleted_biblios.t >index 2f13fb7189..625e64fac4 100755 >--- a/t/db_dependent/api/v1/deleted_biblios.t >+++ b/t/db_dependent/api/v1/deleted_biblios.t >@@ -36,6 +36,7 @@ use C4::Circulation qw( AddIssue AddReturn ); > > use Koha::Biblios; > use Koha::Database; >+use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Checkouts; > use Koha::Old::Checkouts; > >@@ -164,7 +165,7 @@ subtest 'get() tests' => sub { > > subtest 'list() tests' => sub { > >- plan tests => 17; >+ plan tests => 21; > > $schema->storage->txn_begin; > >@@ -228,6 +229,27 @@ subtest 'list() tests' => sub { > > $t->get_ok( "//$userid:$password@/api/v1/deleted/biblios?q=$query" => { Accept => 'text/plain' } )->status_is(200); > >+ my $old_biblio_1 = Koha::Old::Biblios->find($biblio_id_1); >+ my $old_biblio_2 = Koha::Old::Biblios->find($biblio_id_2); >+ >+ $old_biblio_1->set( { timestamp => dt_from_string('2024-12-12T17:33:57+00:00') } )->store(); >+ $old_biblio_2->set( { timestamp => dt_from_string('2024-12-11T17:33:57+00:00') } )->store(); >+ >+ $query = encode_json( >+ { >+ "-and" => [ >+ { 'me.deleted_on' => { '>=' => '2024-12-12T00:00:00+00:00' } }, >+ [ >+ { biblio_id => $old_biblio_1->id }, >+ { biblio_id => $old_biblio_2->id }, >+ ] >+ ] >+ } >+ ); >+ >+ $t->get_ok( "//$userid:$password@/api/v1/deleted/biblios?q=$query" => { Accept => 'application/json' } ) >+ ->status_is(200)->json_is( '/0/biblio_id' => $old_biblio_1->id )->json_is( '/1/biblio_id' => undef ); >+ > # DELETE any biblio with ISBN = TOMAS > Koha::Biblios->search( { 'biblioitem.isbn' => 'TOMAS' }, { join => ['biblioitem'] } )->delete; > >-- >2.39.5
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 38678
:
175376
|
175377
|
175669
|
175670
|
175671
|
175672
|
175988
|
175989