Place the beans in a large saucepan with the onion, rosemary and bay leaf. Pour over water so that the beans are just covered. Place the pan over a high heat and bring to the boil, remove any scum from the water then reduce to a simmer. Leave to cook for 1 hour, pouring over 200ml of cold water every 20 minutes. Check regularly, the beans need to be covered with water throughout cooking. After 1 hour stir in the olive oil and season with salt. Leave to cook for a further 30 minutes or until just tender.
Place the wine and cockles in a saucepan over a high heat, cover with lid and cook for 2-3 minutes shaking a few times until all the cockles have opened (any that don’t open discard). remove the meat from two thirds of the cockles, discarding their shells (set aside until ready to use). Strain the cooking wine through a fine sieve to remove any sand and set aside.
Heat the oil in a large frying pan or casserole pan, place over a moderate heat. Add the onions to the pan. Cook until the onions are transparent. Add the chorizo and garlic to the pan and fry until the chorizo is just cooked. Stir in the chillies, tomatoes and reserved cooking wine. Bring to a strong simmer and carefully mix in the cooked beans and cockles so that they are well combined. Leave to cook over a moderate heat for 5-8 minutes, stirring regularly until all the ingredients are heated through. Stir in the parsley (reserving a little to scatter on top), season with salt and pepper to taste. Serve garnished with chopped parsley on it’s on or accompanied with slices of good bread