https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23049
Marcel de Rooy <m.de.r...@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #213 from Marcel de Rooy <m.de.r...@rijksmuseum.nl> --- [FAIL] t/db_dependent/Accounts.t [FAIL] t/db_dependent/Koha/Account.t [FAIL] t/db_dependent/Koha/Account/Lines.t [1] Comment on the first failure in Accounts.t ok 14 - outstanding_debits returns a list of Koha::Account::Line objects in list context DBD::mysql::st execute failed: CONSTRAINT `accountlines_check_type` failed for `koha_master`.`accountlines` [for Statement "INSERT INTO `accountlines` ( `amountoutstanding`, `borrowernumber`, `interface`) VALUES ( ?, ?, ? )" with ParamValues: 0=-2, 1=102, 2='commandline'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. # Looks like you planned 22 tests but ran 14. not ok 2 - outstanding_debits() tests # Failed test 'outstanding_debits() tests' # at t/db_dependent/Koha/Account.t line 113. Coming from: # create a pathological credit with amountoutstanding > 0 (BZ 14591) Koha::Account::Line->new({ borrowernumber => $patron_4->id, amount => -3, amountoutstanding => 3, interface => 'commandline' })->store(); => This statement obviously fails, since we do not set accounttype or debittype. I am inclined to think that we should start without the type check constraint. Pretty sure that we did not catch all occurrences in code where an account line is added without one of the two types. [2] The first problem in Lines.t t/db_dependent/Koha/Account/Lines.t .. 8/9 DBD::mysql::st execute failed: CONSTRAINT `accountlines_check_type` failed for `koha_master`.`accountlines` [for Statement "INSERT INTO `accountlines` ( `amount`, `amountoutstanding`, `borrowernumber`, `interface`) VALUES ( ?, ?, ?, ? )" with ParamValues: 0=10, 1=10, 2='115', 3='commandline'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. # No tests run! # Failed test 'No tests run for subtest "void() tests"' # at t/db_dependent/Koha/Account/Lines.t line 591. What about: my $line1 = Koha::Account::Line->new({ borrowernumber => $borrower->borrowernumber, amount => 10, amountoutstanding => 10, interface => 'commandline' })->store(); Here another insert that should fail because of the new constraint. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/