Is it acceptable to use memorised phrases in the writing and speaking tests? Well, it depends. Take the sentence below as an example. A student asked me whether it can be used at the beginning of a letter (general writing task 1).
I hope this letter ﬁnds you well. Sorry I didn't write to you earlier, but I’ve been working ﬂat out since the moment I arrived home.
If the question tells you to begin by explaining to your friend why you haven't contacted him/her for a while, then this sentence would be perfect.
However, if the question does not tell you to explain why you didn't write earlier, the sentence is irrelevant. It will be clear to the examiner that you have used that phrase because it looks good, and not because it fits the question.
Can you see the difference? The examiner will only be impressed if your memorised phrases fit the question perfectly.