Some refactor in test_policies.py