@@ -, +, @@ `secret` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, # Failed test 'Exception is thrown correctly' # at t/db_dependent/Koha/Object.t line 262. # expecting: Koha::Exceptions::Object::FKConstraint # found: DBIx::Class::Exception (DBIx::Class::Storage::DBI::_dbh_execute(): Field 'description' doesn't have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 125 # ) # Looks like you planned 7 tests but ran 1. # Looks like you failed 1 test of 1 run. --- t/db_dependent/Koha/ApiKeys.t | 2 +- t/db_dependent/Koha/Object.t | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) --- a/t/db_dependent/Koha/ApiKeys.t +++ a/t/db_dependent/Koha/ApiKeys.t @@ -80,7 +80,7 @@ subtest 'store() tests' => sub { $patron_to_delete->delete; throws_ok - { Koha::ApiKey->new({ patron_id => $deleted_id })->store } + { Koha::ApiKey->new({ patron_id => $deleted_id, description => 'a description' })->store } 'Koha::Exceptions::Object::FKConstraint', 'Invalid patron ID raises exception'; is( $@->message, 'Broken FK constraint', 'Exception message is correct' ); --- a/t/db_dependent/Koha/Object.t +++ a/t/db_dependent/Koha/Object.t @@ -253,7 +253,7 @@ subtest 'store() tests' => sub { my $patron_id = $patron->id; $patron->delete; - my $api_key = Koha::ApiKey->new({ patron_id => $patron_id }); + my $api_key = Koha::ApiKey->new({ patron_id => $patron_id, secret => 'a secret', description => 'a description' }); my $print_error = $schema->storage->dbh->{PrintError}; $schema->storage->dbh->{PrintError} = 0; @@ -278,6 +278,7 @@ subtest 'store() tests' => sub { my $new_api_key = Koha::ApiKey->new({ patron_id => $patron_id, secret => $api_key->secret, + description => 'a description', }); throws_ok --