fixed tests to properly test for new logic in db.py: getattr, getitem and mode