Right now, it only warns and continues. While this might mean 'there already exists a resource with the value we need for the test', this is really hiding a design issue with the tests. For example ```perl my $library = $builde->build_object( { class => 'Koha::Libraries, value => { branchcode => 'ILL', pickup_location => 1 } } ); ``` might fail because 'ILL' already exists, but if the DB entry doesn't contain the other fixed condition (pickup_location=1) then the tests could fail weirdly, and tracking it would be harder (i.e. you read the code, see you are setting pickup_location=1, but it fails because it is not). I propose we make it explode loudly instead. And fix the poorly written tests that explode because of it.
Sounds sensible to me
IIRC we decided that on purpose, so the test does not fail if the DB had the data before running the tests.
But yes, I agree we could change the behaviour and explode instead. In your example we do not care about the branchcode, we should build a library with a random branchcode and reuse it later.