There's a bit of missing info in the OP: how much time is this project expected to take? If it's literally 2 hours or something, then fine, don't pay me. If you want me to spend 8+ hours developing a polished looking site or a standalone API, then I'm probably not going to do your interview unless passing the test gets me straight to the offer stage.
Roughly speaking, I can get to an offer decision after:
1 recruiter call (20-30 minutes, usually, pretty softball).
1 or 2 phone screens (30-60 minutes apiece, generally).
1 day onsite for 4-6 hours.
If you're going to demand much more than that amount of time from me, you have to offer something compelling. The definition of "compelling" varies depending how much I think I need a new job.