Test fix.
[blog.pm-common-perl-mods.git] / Rose-DB-Object-I18N / t / load-i18n-with-wrong-language.t
blobcff93893e39e67578afbfde595d818067bafeacd
1 #! /usr/bin/perl
3 use strict;
4 use warnings;
6 use Test::More 'tests' => 3;
8 use lib 't/lib';
10 use NewDB;
11 use User;
12 use User::Manager;
14 my $db = NewDB->new();
16 $db->init();
18 my $u = User->new(
19 name => 'zzz',
20 orig_lang => 'en',
21 signature => 'hello'
23 $u->save();
25 $u = User->new( id => $u->id );
26 $u->load();
27 ok( not defined $u->i18n );
29 is( $u->load_i18n( language => 'aa', speculative => 1 ), 0 );
31 eval { $u->load_i18n( language => 'bu' ); };
32 ok( $@ );
34 $u->delete( cascade => 1 );