Bugzilla – Attachment 71417 Details for
Bug 20144
Test suite is failing with new default SQL modes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20144: [sql_modes] Fix date format in tests
Bug-20144-sqlmodes-Fix-date-format-in-tests.patch (text/plain), 10.43 KB, created by
Julian Maurice
on 2018-02-12 09:49:42 UTC
(
hide
)
Description:
Bug 20144: [sql_modes] Fix date format in tests
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2018-02-12 09:49:42 UTC
Size:
10.43 KB
patch
obsolete
>From ec576fee1bc5d0c0ac0df5d9d3031b9fd7bf68d6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 5 Feb 2018 15:39:49 -0300 >Subject: [PATCH] Bug 20144: [sql_modes] Fix date format in tests > >Fix for: >Incorrect date value: '01-01-2013' for column 'startdate' >Incorrect date value: '01-01-2016' for column 'budget_period_enddate' >Incorrect date value: '30-11-2013' for column 'enddate' >Incorrect date value: '31-12-2015' for column 'budget_period_enddate' >Incorrect date value: '12-31-2015' for column 'budget_period_enddate' >Incorrect date value: '01-01-2014' for column 'entrydate' > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > t/db_dependent/Acquisition/OrderFromSubscription.t | 14 +++++++------- > t/db_dependent/Acquisition/OrderUsers.t | 2 +- > t/db_dependent/AdditionalField.t | 4 ++-- > t/db_dependent/Bookseller.t | 22 +++++++++++----------- > t/db_dependent/Koha/Acquisition/Booksellers.t | 8 ++++---- > t/db_dependent/Serials.t | 4 ++-- > 6 files changed, 27 insertions(+), 27 deletions(-) > >diff --git a/t/db_dependent/Acquisition/OrderFromSubscription.t b/t/db_dependent/Acquisition/OrderFromSubscription.t >index 874459acb4..cc691d0585 100644 >--- a/t/db_dependent/Acquisition/OrderFromSubscription.t >+++ b/t/db_dependent/Acquisition/OrderFromSubscription.t >@@ -33,8 +33,8 @@ my $bookseller = Koha::Acquisition::Bookseller->new( > my ($biblionumber, $biblioitemnumber) = AddBiblio(MARC::Record->new, ''); > my $budgetid; > my $bpid = AddBudgetPeriod({ >- budget_period_startdate => '01-01-2015', >- budget_period_enddate => '12-31-2015', >+ budget_period_startdate => '2015-01-01', >+ budget_period_enddate => '2015-12-31', > budget_period_description => "budget desc" > }); > >@@ -48,11 +48,11 @@ my $budget_id = AddBudget({ > > my $subscriptionid = NewSubscription( > undef, "", undef, undef, $budget_id, $biblionumber, >- '01-01-2013',undef, undef, undef, undef, >+ '2013-01-01',undef, undef, undef, undef, > undef, undef, undef, undef, undef, undef, >- 1, "notes",undef, '01-01-2013', undef, undef, >+ 1, "notes",undef, '2013-01-01', undef, undef, > undef, undef, 0, "intnotes", 0, >- undef, undef, 0, undef, '31-12-2013', 0 >+ undef, undef, 0, undef, '2013-12-31', 0 > ); > die unless $subscriptionid; > >@@ -64,7 +64,7 @@ my $subscription = GetSubscription( $subscriptionid ); > > my $order = Koha::Acquisition::Order->new({ > biblionumber => $subscription->{biblionumber}, >- entrydate => '01-01-2013', >+ entrydate => '2013-01-01', > quantity => 1, > currency => $curcode, > listprice => $cost, >@@ -88,7 +88,7 @@ $dbh->do(q{DELETE FROM aqinvoices}); > my $invoiceid = AddInvoice(invoicenumber => 'invoice1', booksellerid => $bookseller->id, unknown => "unknown"); > > my $invoice = GetInvoice( $invoiceid ); >-$invoice->{datereceived} = '02-01-2013'; >+$invoice->{datereceived} = '2013-01-02'; > > my ( $datereceived, $new_ordernumber ) = ModReceiveOrder( > { >diff --git a/t/db_dependent/Acquisition/OrderUsers.t b/t/db_dependent/Acquisition/OrderUsers.t >index 610f8798b5..2581edc60c 100644 >--- a/t/db_dependent/Acquisition/OrderUsers.t >+++ b/t/db_dependent/Acquisition/OrderUsers.t >@@ -49,7 +49,7 @@ my $order = Koha::Acquisition::Order->new( > quantity => 2, > biblionumber => $biblionumber, > budget_id => $budgetid, >- entrydate => '01-01-2014', >+ entrydate => '2014-01-01', > currency => $currency->{currency}, > orderstatus => 1, > quantityreceived => 0, >diff --git a/t/db_dependent/AdditionalField.t b/t/db_dependent/AdditionalField.t >index 0a56ce0f43..59620b8a44 100644 >--- a/t/db_dependent/AdditionalField.t >+++ b/t/db_dependent/AdditionalField.t >@@ -110,8 +110,8 @@ use C4::Serials::Numberpattern; > my ($biblionumber, $biblioitemnumber) = AddBiblio(MARC::Record->new, ''); > my $budgetid; > my $bpid = AddBudgetPeriod({ >- budget_period_startdate => '01-01-2015', >- budget_period_enddate => '01-01-2016', >+ budget_period_startdate => '2015-01-01', >+ budget_period_enddate => '2016-01-01', > }); > > my $budget_id = AddBudget({ >diff --git a/t/db_dependent/Bookseller.t b/t/db_dependent/Bookseller.t >index c602ff4553..b9de02cf9c 100644 >--- a/t/db_dependent/Bookseller.t >+++ b/t/db_dependent/Bookseller.t >@@ -189,9 +189,9 @@ is( $bookseller1fromid->subscriptions->count, > > my $id_subscription1 = NewSubscription( > undef, 'BRANCH2', $id_supplier1, undef, $id_budget, $biblionumber, >- '01-01-2013',undef, undef, undef, undef, >+ '2013-01-01',undef, undef, undef, undef, > undef, undef, undef, undef, undef, undef, >- 1, "subscription notes",undef, '01-01-2013', undef, undef, >+ 1, "subscription notes",undef, '2013-01-01', undef, undef, > undef, 'CALL ABC', 0, "intnotes", 0, > undef, undef, 0, undef, '2013-11-30', 0 > ); >@@ -201,9 +201,9 @@ is($subscriptions[0]->{publicnotes}, 'subscription notes', 'subscription search > > my $id_subscription2 = NewSubscription( > undef, 'BRANCH2', $id_supplier1, undef, $id_budget, $biblionumber, >- '01-01-2013',undef, undef, undef, undef, >+ '2013-01-01',undef, undef, undef, undef, > undef, undef, undef, undef, undef, undef, >- 1, "subscription notes",undef, '01-01-2013', undef, undef, >+ 1, "subscription notes",undef, '2013-01-01', undef, undef, > undef, 'CALL DEF', 0, "intnotes", 0, > undef, undef, 0, undef, '2013-07-31', 0 > ); >@@ -330,9 +330,9 @@ ModBasket($basket4info); > #Add 1 subscription > my $id_subscription3 = NewSubscription( > undef, "BRANCH1", $id_supplier1, undef, $id_budget, $biblionumber, >- '01-01-2013',undef, undef, undef, undef, >+ '2013-01-01',undef, undef, undef, undef, > undef, undef, undef, undef, undef, undef, >- 1, "subscription notes",undef, '01-01-2013', undef, undef, >+ 1, "subscription notes",undef, '2013-01-01', undef, undef, > undef, undef, 0, "intnotes", 0, > undef, undef, 0, 'LOCA', '2013-12-31', 0 > ); >@@ -355,7 +355,7 @@ my $order1 = Koha::Acquisition::Order->new( > quantity => 24, > biblionumber => $biblionumber, > budget_id => $id_budget, >- entrydate => '01-01-2013', >+ entrydate => '2013-01-01', > currency => $curcode, > notes => "This is a note1", > tax_rate => 0.0500, >@@ -364,7 +364,7 @@ my $order1 = Koha::Acquisition::Order->new( > quantityreceived => 2, > rrp => 10, > ecost => 10, >- datereceived => '01-06-2013' >+ datereceived => '2013-06-01' > } > )->store; > my $ordernumber1 = $order1->ordernumber; >@@ -375,7 +375,7 @@ my $order2 = Koha::Acquisition::Order->new( > quantity => 20, > biblionumber => $biblionumber, > budget_id => $id_budget, >- entrydate => '01-01-2013', >+ entrydate => '2013-01-01', > currency => $curcode, > notes => "This is a note2", > tax_rate => 0.0500, >@@ -393,7 +393,7 @@ my $order3 = Koha::Acquisition::Order->new( > quantity => 20, > biblionumber => $biblionumber, > budget_id => $id_budget, >- entrydate => '02-02-2013', >+ entrydate => '2013-02-02', > currency => $curcode, > notes => "This is a note3", > tax_rate => 0.0500, >@@ -411,7 +411,7 @@ my $order4 = Koha::Acquisition::Order->new( > quantity => 20, > biblionumber => $biblionumber, > budget_id => $id_budget, >- entrydate => '02-02-2013', >+ entrydate => '2013-02-02', > currency => $curcode, > notes => "This is a note3", > tax_rate => 0.0500, >diff --git a/t/db_dependent/Koha/Acquisition/Booksellers.t b/t/db_dependent/Koha/Acquisition/Booksellers.t >index 31342e07af..010993e059 100644 >--- a/t/db_dependent/Koha/Acquisition/Booksellers.t >+++ b/t/db_dependent/Koha/Acquisition/Booksellers.t >@@ -110,11 +110,11 @@ subtest '->subscriptions() tests' => sub { > # Add two subscriptions > my $subscription_1_id = NewSubscription( > undef, 'BRANCH2', $vendor->id, undef, >- $id_budget, $biblionumber, '01-01-2013', undef, >+ $id_budget, $biblionumber, '2013-01-01', undef, > undef, undef, undef, undef, > undef, undef, undef, undef, > undef, 1, "subscription notes", undef, >- '01-01-2013', undef, undef, undef, >+ '2013-01-01', undef, undef, undef, > 'CALL ABC', 0, "intnotes", 0, > undef, undef, 0, undef, > '2013-11-30', 0 >@@ -128,11 +128,11 @@ subtest '->subscriptions() tests' => sub { > > my $id_subscription2 = NewSubscription( > undef, 'BRANCH2', $vendor->id, undef, >- $id_budget, $biblionumber, '01-01-2013', undef, >+ $id_budget, $biblionumber, '2013-01-01', undef, > undef, undef, undef, undef, > undef, undef, undef, undef, > undef, 1, "subscription notes", undef, >- '01-01-2013', undef, undef, undef, >+ '2013-01-01', undef, undef, undef, > 'CALL DEF', 0, "intnotes", 0, > undef, undef, 0, undef, > '2013-07-31', 0 >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index de623fe731..83d8b98c19 100755 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -51,8 +51,8 @@ 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_startdate => '2015-01-01', >+ budget_period_enddate => '2015-12-31', > budget_period_description => "budget desc" > }); > >-- >2.14.2
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 20144
:
71410
|
71411
|
71412
|
71413
|
71414
|
71415
|
71416
| 71417 |
71418
|
71419
|
71420
|
71421
|
71422
|
71423
|
71424
|
71425
|
71427
|
71428
|
71429
|
71430
|
71431
|
71432
|
71434
|
71435
|
71436
|
71437
|
71438
|
71440
|
71441
|
71442
|
71443
|
71444
|
71445
|
71446
|
71447
|
71448
|
71449
|
71450
|
71451
|
71452
|
71453
|
71454
|
71455
|
71456
|
71457
|
71458
|
71459
|
71460
|
71461
|
71462
|
71463
|
71467
|
71564