Bug 40378: Remove warnings from api/v1/biblios.t
t/db_dependent/api/v1/biblios.t .. 12/15 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'cZt7U7mP0KD' for key 'itembarcodeidx' at /kohadevbox/koha/Koha/Obj ect.pm line 174 t/db_dependent/api/v1/biblios.t .. 13/15 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'N44vCoe4tX41' for key 'itembarcodeidx' at /kohadevbox/koha/Koha/Ob ject.pm line 174 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit71eb056850) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> (cherry picked from commit3b4e9dc5cb) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
d2af4f0da4
commit
e022f334c2
|
|
@ -20,7 +20,8 @@ use Modern::Perl;
|
|||
use utf8;
|
||||
use Encode;
|
||||
|
||||
use Test::More tests => 15;
|
||||
use Test::More tests => 16;
|
||||
use Test::NoWarnings;
|
||||
use Test::MockModule;
|
||||
use Test::Mojo;
|
||||
use Test::Warn;
|
||||
|
|
@ -1909,7 +1910,7 @@ subtest 'list() tests' => sub {
|
|||
|
||||
subtest 'add_item() tests' => sub {
|
||||
|
||||
plan tests => 8;
|
||||
plan tests => 10;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
|
|
@ -1959,17 +1960,20 @@ subtest 'add_item() tests' => sub {
|
|||
|
||||
my $item = $builder->build_sample_item();
|
||||
|
||||
$t->post_ok(
|
||||
"//$userid:$password@/api/v1/biblios/$biblio_id/items" => json => {
|
||||
external_id => $item->barcode,
|
||||
}
|
||||
)->status_is( 409, 'Duplicate barcode' );
|
||||
warnings_like {
|
||||
$t->post_ok(
|
||||
"//$userid:$password@/api/v1/biblios/$biblio_id/items" => json => {
|
||||
external_id => $item->barcode,
|
||||
}
|
||||
)->status_is( 409, 'Duplicate barcode' )->json_is( "/error" => "Duplicate barcode." );
|
||||
}
|
||||
qr{DBD::mysql::st execute failed: Duplicate entry '(.*?)' for key '(.*\.?)itembarcodeidx'};
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
||||
subtest 'update_item() tests' => sub {
|
||||
plan tests => 7;
|
||||
plan tests => 9;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
|
|
@ -2012,10 +2016,14 @@ subtest 'update_item() tests' => sub {
|
|||
|
||||
my $other_item = $builder->build_sample_item();
|
||||
|
||||
$t->put_ok("//$userid:$password@/api/v1/biblios/$biblio_id/items/$item_id" => json => {
|
||||
external_id => $other_item->barcode,
|
||||
})
|
||||
->status_is(409, 'Barcode not unique');
|
||||
warnings_like {
|
||||
$t->put_ok(
|
||||
"//$userid:$password@/api/v1/biblios/$biblio_id/items/$item_id" => json => {
|
||||
external_id => $other_item->barcode,
|
||||
}
|
||||
)->status_is( 409, 'Barcode not unique' )->json_is( "/error" => "Duplicate barcode." );
|
||||
}
|
||||
qr{DBD::mysql::st execute failed: Duplicate entry '(.*?)' for key '(.*\.?)itembarcodeidx'};
|
||||
|
||||
$t->put_ok("//$userid:$password@/api/v1/biblios/$biblio_id/items/$item_id" => json => {
|
||||
replacement_price => 30,
|
||||
|
|
|
|||
Loading…
Reference in New Issue