I have re-wrote the test using batch_test module .