Heat a skillet with oil over medium heat. Add the onion, garlic and chiles and continue cooking, stirring often, until the onion is soft. Add the tomatoes and cumin and cook 5 minutes more. Add the beans and salt to taste. Cook covered for 30 minutes then uncovered for another 30 minutes. I like to smoosh my beans a little to create a thicker consistency.
Mix the yeast with the warm water and let it sit for five minutes.
Combine the flour and salt. Add the butter and sugar to the yeast/water mixture and then slowly add to the flour and salt. Knead for two minutes, until dough is smooth and elastic. Rise in a covered, greased bowl for one hour or until dough is doubled in size.
After dough has risen, punch it down, and on a floured surface, roll it out into a 1/4-inch thick rectangle. Using a knife or pizza cutter, cut out 3 inch squares, and then cut squares on the diagonal into triangles.
Heat up three inches of oil in a big pot to 375 degrees. Fry two triangles of dough at a time in the oil for one minute on each side. The dough should puff when it hits the oil. Drain on paper towels (Makes about 18 sopapillas).