Fix tear down foreign key constraint violation exception tests

Fixes failing tests introduced in #704.