Prepare and cook the beans as per directions on pack. Drain thoroughly. Set aside.
Meanwhile, peel eggplants, slice thinly and sprinkle with salt. Put into a colander, place over a bowl and leave for 30 minutes.
Meanwhile, add tomatoes to the frypan and cook, stirring frequently until soft. Stir in basil, garlic and tomato paste. Season to taste. Set aside.
Rinse eggplant slices in cold water and drain thoroughly. Pat eggplant dry with paper towel. Sprinkle lightly with flour. Heat oil in frypan and place a layer of eggplant slices in the pan, cooking until golden brown on both sides. Remove from the pan and set aside until all eggplant slices are cooked.
Preheat oven to 180oC. Place a small amount of tomato sauce covering the bottom of a shallow baking dish. Cover with a layer of eggplant slices slightly overlapping each other, then half the beans. Sprinkle half of both cheeses. Top with tomato sauce, another layer of eggplant, beans, remaining sauce and then finish with a final layer of eggplant and sprinkle remaining cheeses evenly on top.
Bake in preheated oven for approximately 30 minutes, or until the cheese is golden brown.