In a large bowl, cream together the margarine/butter and sugar until light and fluffy. Sift in the flour and mix until a soft dough forms. Use your hands to bring it together if needed. Gently knead the dough, wrap it in clingfilm, and chill in the fridge for 30 minutes.
Preheat your oven to 180°c (160°c fan-assisted ovens, Gas Mark 4 or 350°F). Grease a 12-hole muffin tin with a little excess margarine/butter, lightly dust with a little excess flour, and set aside.
Roll the chilled dough to 5mm thick. Using a round cutter slightly larger than the muffin tin holes, cut 12 circles. Carefully transfer each circle to the greased tray, pressing it into place.
Prick the base of each pastry cup, line with a paper cupcake case, and fill with baking beans. Bake for 10 minutes until partially baked.
Remove from the oven, and carefully remove the baking beans. Spoon 1 teaspoon of raspberry jam into the base of each pastry case while still warm. Set aside to prepare the filling.