def test_save(self, mock_is_instance, mock_save):
        mock_is_instance.return_value = True
        mock_save.return_value = MockModel(uid=ObjectId())

        serializer = MLModelSerializer()
        saved_instance = serializer.save(MockModel())

        self.assertIsNotNone(saved_instance.uid)
    def test_save_invalid_instance(self):
        serializer = MLModelSerializer()

        with self.assertRaises(TypeError):
            serializer.save(MockModel())