Database model unit tests

Change-Id: Ia9d092c75ade7d5d89092975f9883d7c1b153261