For the pastry: Place the flour and margarines into a large bowl and, using a knife or fork, mash the butter into the flour until you have fine breadcrumbs
Add the sugar and mix through
Add the egg to the mix and bring together to form a dough. If you need to, add a tiny bit of cold water to bring it together. I didn’t need to but it will depend on the flour you use
Wrap in cling film and chill for 20 minutes before using
Flour the surface well before rolling out to slightly larger than your flan tin. Roll the pastry onto your rolling pin and carefully unroll into the tin. If it breaks just patch it up!
Leave to chill again in the fridge for 20 minutes
Remove from fridge and prick all over with a fork. Then line the pastry with tin foil and fill with baking beans or uncooked rice (don't then cook the rice and eat it though!).
Bake for approx. 10 – 15 minutes at 200 degrees or 180 degree fan then remove the foil and bake for a further 5-10 minutes until the pastry is lightly brown and dried out. Set aside while you make the filling.
For the filling: Melt the margarine and chocolate over a low heat in a pan.
Remove from the heat and add the sugar, flour and eggs, one at a time, beating well between each addition.
Place the pastry case in its tin on a baking tray and fill with the chocolate mixture. Bake in the oven for 10-12 minutes until firm on the edges but slightly wobbly in the middle.
Leave to cool then sprinkle with icing sugar before serving.