code: def test_widget_delete_with_view(self):
      data = {"a": np.arange(0, 50)}
      widget = PerspectiveWidget(data)
  
      # create a view on the manager
      table_name, table = list(widget.manager._tables.items())[0]
      make_view_message = {
          "id": 1,
          "table_name": table_name,
          "view_name": "view1",
          "cmd": "view",
          "config": {"group_by": ["a"]},
      }
      widget.manager._process(make_view_message, lambda x: True)
  
      assert len(widget.manager._views) == 1
  
      mocked_post = partial(mock_post, assert_msg={"cmd": "delete"})
  
      widget.post = MethodType(mocked_post, widget)
      widget.delete()
  
      assert widget.table is None
  
imports: from datetime import date, datetime
  from functools import partial
  from types import MethodType
  import numpy
  from perspective import PerspectiveError, PerspectiveWidget, Table
  from pytest import raises
label_desc: Use image node_id 27 for calling the TestWidget obj's underlying member method code with example usage: obj.test_widget_delete_with_view() without return types