code: def test_move_layout_nested_with_existing_template(self):
      fig = go.Figure(
          layout={
              "font": {"family": "Courier New"},
              "title": "Hello",
              "template": {
                  "layout": {"font": {"family": "Arial", "size": 10}}
              },
          }
      )
  
      templated_fig = pio.to_templated(fig)
  
      expected_fig = go.Figure(
          layout={
              "template": {
                  "layout": {
                      "font": {"family": "Courier New", "size": 10}
                  }
              },
              "title": "Hello",
          }
      )
      self.assertEqual(templated_fig, expected_fig)
  
imports: import copy
  from unittest import TestCase
  import pytest
  import plotly.io
  import plotly.graph_objs
  from plotly.tests.utils import TestCaseNoTemplate
label_desc: Use image node_id 3 for calling the TestToTemplated obj's underlying member method code with example usage: obj.test_move_layout_nested_with_existing_template() without return types