fixed database relationship in tests