Getting rid of deprecation warning in tests