db.py/test_db.py: updated to take meter.meter_type into consideration