Bug 8300: Add mechanized unit test for batch import
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Sat, 23 Jun 2012 20:55:43 +0000 (16:55 -0400)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Wed, 1 May 2013 11:57:28 +0000 (07:57 -0400)
commit201dab65a54c63243bd49af0fc6925eecb135eec
treee4e96085adf41e907a7d4d2269efab18693d602e
parent2dd84414484314d9ac3fbdf2704bdf4cc6408d3a
Bug 8300: Add mechanized unit test for batch import

This new unit test confirms that importing records via the Stage
MARC import tool still works by connecting to a Koha instance and
importing a record then reverting the import, checking at each step
of the way that everything is as it should be.

To test:
1. Install Test::WWW::Mechanize
> sudo apt-get install libtest-www-mechanize-perl
2. Set environment variables to reflect your Koha instance:
> export KOHA_USER=kohaadmin
> export KOHA_PASS=katikoan
> export KOHA_INTRANET_URL=http://localhost:8080
> export KOHA_OPAC_URL=http://localhost
3. Run the test:
> prove t/db_dependent/www/batch.t

This updated patch now handles both MARC21 and UNIMARC installations.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
All tests pass with marcflavour = MARC21 and NORMARC. Test #15 fails
when marcflavour = UNIMARC, but from what I can see, that is because
I'm testing on a MARC21 setup, missing the UNIMARC frameworks etc.
I'm signing off - QA folks, please ask for a proper UNIMARC signoff
if you feel it is needed.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: Load the POSIX module (for the floor routine).
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit bc2ab3b5882e664d91ce086ce96dd32c7452dee4)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
t/db_dependent/www/batch.t [new file with mode: 0644]
t/db_dependent/www/data/marc21record.mrc [new file with mode: 0644]
t/db_dependent/www/data/unimarcrecord.mrc [new file with mode: 0644]