fix tests

Previous changes made tests not run, namely has_many relation
and the deletion restriction. These changes fix those.

Signed-off-by: Zeljko <zeljko@zwr.fi>