Refactor test_create_task