+subtest 'accountlines' => sub {
+ plan tests => 3;
+
+ my $accountline = Koha::Account::Line->new(
+ {
+ issue_id => $retrieved_checkout_1->id,
+ borrowernumber => $retrieved_checkout_1->borrowernumber,
+ itemnumber => $retrieved_checkout_1->itemnumber,
+ branchcode => $retrieved_checkout_1->branchcode,
+ date => \'NOW()',
+ debit_type_code => 'OVERDUE',
+ status => 'UNRETURNED',
+ interface => 'cli',
+ amount => '1',
+ amountoutstanding => '1',
+ }
+ )->store();
+
+ my $accountlines = $retrieved_checkout_1->accountlines;
+ is( ref($accountlines), 'Koha::Account::Lines',
+ 'Koha::Checkout->accountlines should return a Koha::Item' );
+
+ my $line = $accountlines->next;
+ is( ref($line), 'Koha::Account::Line',
+ 'next returns a Koha::Account::Line' );
+
+ is(
+ $accountline->id,
+ $line->id,
+ 'Koha::Checkout->accountlines should return the correct accountlines'
+ );
+};
+