Move serializer import to top-level causes test error