Bugzilla – Attachment 18201 Details for
Bug 10275
UT: OrderFromSubscription.t needs to create its own data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
MT10275: UT: OrderFromSubscription.t needs to create its own data
MT10275-UT-OrderFromSubscriptiont-needs-to-create-.patch (text/plain), 3.20 KB, created by
Jonathan Druart
on 2013-05-17 13:29:16 UTC
(
hide
)
Description:
MT10275: UT: OrderFromSubscription.t needs to create its own data
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-05-17 13:29:16 UTC
Size:
3.20 KB
patch
obsolete
>From 8f9ccba565511d88ca046953572eaf56ac2254a1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 17 May 2013 15:27:45 +0200 >Subject: [PATCH] MT10275: UT: OrderFromSubscription.t needs to create its own > data > >Try before the patch: >prove t/db_dependent/Acquisition/OrderFromSubscription.t > >And after, it should produce: > t/db_dependent/Acquisition/OrderFromSubscription.t .. ok > All tests successful. > Files=1, Tests=12, 2 wallclock secs ( 0.02 usr 0.00 sys + 0.46 cusr > 0.02 csys = 0.50 CPU) > Result: PASS > >And some warnings... >--- > t/db_dependent/Acquisition/OrderFromSubscription.t | 41 ++++++++++++++------ > 1 file changed, 30 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/Acquisition/OrderFromSubscription.t b/t/db_dependent/Acquisition/OrderFromSubscription.t >index 91936a8..aa9a4a3 100644 >--- a/t/db_dependent/Acquisition/OrderFromSubscription.t >+++ b/t/db_dependent/Acquisition/OrderFromSubscription.t >@@ -1,19 +1,29 @@ > use Modern::Perl; > >-use Test::More tests => 10; >+use Test::More tests => 12; > use Data::Dumper; > >-use_ok('C4::Serials'); >-use_ok('C4::Budgets'); > use_ok('C4::Acquisition'); >+use_ok('C4::Biblio'); >+use_ok('C4::Budgets'); >+use_ok('C4::Serials'); > my $supplierlist=eval{GetSuppliersWithLateIssues()}; > ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues"); > >-my $biblionumber = 1; >+my $booksellerid = C4::Bookseller::AddBookseller( >+ { >+ name => "my vendor", >+ address1 => "bookseller's address", >+ phone => "0123456", >+ active => 1 >+ } >+); >+ >+my ($biblionumber, $biblioitemnumber) = AddBiblio(MARC::Record->new, ''); > my $budgetid; > my $bpid = AddBudgetPeriod({ > budget_period_startdate => '01-01-2015', >- budget_period_enddate => '31-12-2015', >+ budget_period_enddate => '12-31-2015', > budget_description => "budget desc" > }); > >@@ -36,16 +46,21 @@ my $subscriptionid = NewSubscription( > "intnotes", 0, undef, undef, 0, undef, '31-12-2013', > ); > die unless $subscriptionid; >+ >+my ($basket, $basketno); >+ok($basketno = NewBasket($booksellerid, 1), "NewBasket( $booksellerid , 1 ) returns $basketno"); >+ > my $cost = 42.00; > my $subscription = GetSubscription( $subscriptionid ); >-my ( $basketno, $ordernumber ) = NewOrder({ >+my $ordernumber; >+( $basketno, $ordernumber ) = NewOrder({ > biblionumber => $subscription->{biblionumber}, > entrydate => '01-01-2013', > quantity => 1, > currency => 'USD', > listprice => $cost, > notes => "This is a note", >- basketno => 1, >+ basketno => $basketno, > rrp => $cost, > ecost => $cost, > gstrate => 0.0500, >@@ -73,7 +88,11 @@ $order = GetLastOrderNotReceivedFromSubscriptionid( $subscription->{subscription > is ( $order, undef, "test no not received order for a received order"); > > # cleaning >-DelSubscription( $subscription->{subscriptionid} ); >-DelOrder( $subscription->{biblionumber}, $ordernumber ); >-DelBudgetPeriod($bpid); >-DelBudget($budget_id); >+END { >+ DelSubscription( $subscription->{subscriptionid} ); >+ DelOrder( $subscription->{biblionumber}, $ordernumber ); >+ DelBudgetPeriod($bpid); >+ DelBudget($budget_id); >+ DelBasket( $basketno ); >+ DelBiblio($biblionumber); >+}; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10275
:
18201
|
18252
|
19286
|
19306
|
19622
|
19623