The tasks assigned to students in schools essentially consist of a mix of homework (and classwork, and projects, but for my purposes those are interchangeable) and tests (and quizzes, etc). I find it fun to take tests, or at least much more fun than homework. I hope to spread this perception to others, for it seems this mindset is useful in current test-heavy education.
Homework gets assigned and accumulates over spans of multiple days. You (the student) are then tasked to complete it at some point within that long interval, perhaps split into multiple sessions. Some such assignments are unexpectedly large or complicated, and take many hours. Perhaps I have unusual personal difficulties with this. But I find that the presence of assigned homework both weighs painfully on the mind (commonly, "stress") and takes a frustrating effort to act upon and resolve (commonly, "procrastination").
In a test, you are expected to work thru a predefined interval on the order of an hour. There is no particular action expected of you outside that one-time scheduled event. With a test, neither of those issues with homework arise. You needn't worry about having to figure out a time to do it, sith that time is already allocated. You needn't worry about getting yourself to start, sith, when the test happens, it'll be easy to prohibit most other things you could do. A test is essentially a homework assignment, but it's easier to get started and the obligations are bounded in time.
When you do homework, at least before you start, you consider the options of other things to do, and these thoughts may distract you thruout your work. If you take a test, it's at a scheduled time, when you had no other options. You are easily forced to forget about the rest of life and focus on the problems. Once you focus on the material, assuming it's something you know how to do (even if not easily), the test's questions/problems become fun challenges.
Other students appear to worry about, or suffer from, tests, sith they "need to study" for them. One remarked that "even with three weeks of studying, I can only get a B". The solution to that situation is not to panic and study more every time! If you're not winning at tests — especially if you already study a lot — your study is ineffective, and/or you've been fundamentally failing to learn the material. Again, perhaps I'm weird on this. But I find that honestly doing the assignments of the class and studying a bit thruout the course enables success on tests, without any deliberate study shortly before the test. Stop worrying about studying. Just do the rest of the class, take the tests as they come, and mix in some efficient studying as you actually need it. As for how to study efficiently, check any of many other sources.