def test_find_existing_id(self): existing_id = 1 user_with_id = User(first_name='test', last_name='test', email='*****@*****.**', password='******') user_with_id.create() result = User.find_by_id(existing_id) self.assertEqual(result.id, existing_id)
def test_find_nonexistent_id(self): nonexistent_id = 5 user_with_id = User(first_name='test', last_name='test', email='*****@*****.**', password='******') user_with_id.create() result = User.find_by_id(nonexistent_id) self.assertEqual(result, None)