Bug 20144: [sql_modes] Set default value for biblio.datecreated in tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 5 Feb 2018 21:22:34 +0000 (18:22 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 13 Feb 2018 16:58:54 +0000 (13:58 -0300)
When created without Koha::Biblio.

Fix for:
Field 'datecreated' doesn't have a default value

t/db_dependent/Items.t

TODO LATER - Use Koha::Biblio instead

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Items.t

index 8c85959..e10c15e 100755 (executable)
@@ -22,6 +22,7 @@ use Data::Dumper;
 use MARC::Record;
 use C4::Biblio;
 use Koha::Database;
+use Koha::DateUtils qw( dt_from_string );
 use Koha::Library;
 
 use t::lib::Mocks;
@@ -259,6 +260,7 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub {
 
     my $biblio = $schema->resultset('Biblio')->create({
         title       => "Test title",
+        datecreated => dt_from_string,
         biblioitems => [ { itemtype => 'BIB_LEVEL' } ],
     });
     my $biblioitem = $biblio->biblioitems->first;