Heat the oil in a large pot over medium heat, and cook the onions until they have softened. Stir in the garlic, chilli powder and red cayenne pepper. Stir the mushrooms into the frying pan, and continue cooking, stirring frequently, 10 minutes, or until tender. Let any liquid evaporate.
Pour the tomatoes and beans into the frying pan. Season with salt and pepper. Reduce heat to low, cover, and simmer 40 minutes.