write tests for user model