Test for from_bag