Lines 1188-1193
subtest "filter_by_last_update" => sub {
Link Here
|
1188 |
); |
1188 |
); |
1189 |
}; |
1189 |
}; |
1190 |
|
1190 |
|
|
|
1191 |
subtest 'Parameter datetime' => sub { |
1192 |
my $now = dt_from_string(); |
1193 |
my $rs = Koha::Patrons->search({ borrowernumber => { -in => \@borrowernumbers } } ); |
1194 |
$rs->update({ updated_on => $now->clone->subtract( hours => 25 ) }); |
1195 |
is( $rs->filter_by_last_update({ timestamp_column_name => 'updated_on', from => $now })->count, 0, 'All updated yesterday' ); |
1196 |
is( $rs->filter_by_last_update({ timestamp_column_name => 'updated_on', from => $now->clone->subtract( days => 1 ) })->count, |
1197 |
6, 'Yesterday, truncated from is inclusive' ); |
1198 |
is( $rs->filter_by_last_update({ timestamp_column_name => 'updated_on', from => $now->clone->subtract( days => 1 ), |
1199 |
datetime => 1 })->count, 0, 'Yesterday, not truncated, one hour too late' ); |
1200 |
is( $rs->filter_by_last_update({ timestamp_column_name => 'updated_on', from => $now->clone->subtract( hours => 25 ), |
1201 |
datetime => 1 })->count, 6, 'Yesterday - 1h, not truncated, within time frame' ); |
1202 |
}; |
1203 |
|
1191 |
$schema->storage->txn_rollback; |
1204 |
$schema->storage->txn_rollback; |
1192 |
}; |
1205 |
}; |
1193 |
|
1206 |
|
1194 |
- |
|
|