Revision 45119ead
Von Sven Schöling vor mehr als 13 Jahren hinzugefügt
t/helper/csv.t | ||
---|---|---|
1 |
use Test::More tests => 29;
|
|
1 |
use Test::More tests => 31;
|
|
2 | 2 |
use SL::Dispatcher; |
3 | 3 |
use Data::Dumper; |
4 | 4 |
use utf8; |
... | ... | |
208 | 208 |
is $csv->get_objects->[0]->makemodels->[1]->model, 'Table 15', '...check 3'; |
209 | 209 |
is $csv->get_objects->[0]->makemodels->[1]->make, '523', '...check 4'; |
210 | 210 |
|
211 |
###### |
|
212 |
|
|
213 |
$csv = SL::Helper::Csv->new( |
|
214 |
file => \<<EOL, |
|
215 |
description;partnumber;sellprice;lastcost_as_number;buchungsgruppe; |
|
216 |
EOL |
|
217 |
numberformat => '1,000.00', |
|
218 |
class => 'SL::DB::Part', |
|
219 |
profile => { |
|
220 |
buchungsgruppe => "buchungsgruppen.1.description", |
|
221 |
} |
|
222 |
); |
|
223 |
is $csv->parse, undef, 'wrong profile gets rejected'; |
|
224 |
is_deeply $csv->errors, [ 'buchungsgruppen.1.description', undef, "Profile path error. Indexed relationship is not OneToMany around here: 'buchungsgruppen.1'", undef ,0 ], 'error indicates wrong header'; |
|
225 |
|
|
211 | 226 |
# vim: ft=perl |
Auch abrufbar als: Unified diff
Indices auf OneToOne relationships werden jetzt mit Fehler quittiert.