Fixed test

Fixed the test with the code suggested by @bpedro .