Updated tests to be compatible with most recent foreignkey changes.