From 89d3a9e74de896cce15fcf1d0c1b558aa8bd519e Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 21 Mar 2025 10:51:48 -0300 Subject: [PATCH] Bug 39397: Regression tests Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/api/v1/biblios.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/api/v1/biblios.t b/t/db_dependent/api/v1/biblios.t index d0e809dfec5..a3bc6ba7c1a 100755 --- a/t/db_dependent/api/v1/biblios.t +++ b/t/db_dependent/api/v1/biblios.t @@ -1806,7 +1806,7 @@ subtest 'put() tests' => sub { subtest 'list() tests' => sub { - plan tests => 17; + plan tests => 20; $schema->storage->txn_begin; @@ -1871,6 +1871,19 @@ subtest 'list() tests' => sub { $biblio->biblioitem->set( { isbn => 'TOMAS' } )->store; $t->get_ok( "//$userid:$password@/api/v1/biblios?q=$isbn_query" => { Accept => 'text/plain' } )->status_is(200); + my $fixed_date = dt_from_string("2017-01-01 01:00:00"); + my $next_day = $fixed_date->clone->add( days => 1 ); + + # bug 39397 + $biblio->timestamp($fixed_date)->store(); + $biblio->biblioitem->timestamp($next_day)->store(); + + $query = encode_json( { biblio_id => $biblio->id } ); + + $t->get_ok( "//$userid:$password@/api/v1/biblios?q=$query" => { Accept => 'application/json' } )->status_is(200) + ->json_is( '/0/timestamp' => + output_pref( { dt => $fixed_date, dateformat => 'rfc3339' }, 'biblio table timestamp takes precedence' ) ); + $schema->storage->txn_rollback; }; -- 2.49.0