The correct answer is 'are writing'.
Here is the explanation:
The sentence is in the past tense ('wanted to know'), so the verb tense in the subordinate clause must also be in the past. Of the available options, only 'are writing' fits this requirement. However, we need to change 'are' to 'were'. So, this variant is incorrect.
The sentence should look like this: My friend wanted to know when we would write a test.
So, the correct answer is 'would write'.