write model tests and associations