Improve attributes test

This should finish up the rest of the failing cases for model attributes tests. I split them in the commits to reduce the turnaround time. There are still two failing cases due to VIRTUAL fields which are handled in a previous PR.