added more tests to item_purchase and fixed some code in the model