code: def test_property_assignment_template(self):
      # Initialize template object
      self.figure.layout.template = {
          "layout": {"xaxis": {"title": {"text": "x-label"}}}
      }
      self.figure._send_relayout_msg.assert_called_with(
          {
              "template": {
                  "layout": {"xaxis": {"title": {"text": "x-label"}}}
              }
          }
      )
  
      # template layout property
      self.figure.layout.template.layout.title.text = "Template Title"
      self.figure._send_relayout_msg.assert_called_with(
          {"template.layout.title.text": "Template Title"}
      )
  
      # template add trace
      self.figure.layout.template.data = {
          "bar": [
              {"marker": {"color": "blue"}},
              {"marker": {"color": "yellow"}},
          ]
      }
  
      self.figure._send_relayout_msg.assert_called_with(
          {
              "template.data": {
                  "bar": [
                      {"type": "bar", "marker": {"color": "blue"}},
                      {"type": "bar", "marker": {"color": "yellow"}},
                  ]
              }
          }
      )
  
      # template set trace property
      self.figure.layout.template.data.bar[1].marker.opacity = 0.5
      self.figure._send_relayout_msg.assert_called_with(
          {"template.data.bar.1.marker.opacity": 0.5}
      )
  
      # Set elementdefaults property
      self.figure.layout.template.layout.imagedefaults.sizex = 300
      self.figure._send_relayout_msg.assert_called_with(
          {"template.layout.imagedefaults.sizex": 300}
      )
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_core/test_figure_messages/test_plotly_relayout.py
imports: import sys
  from unittest import TestCase
  import plotly.graph_objs
label_desc: Use image node_id 6 for calling the TestRelayoutMessage obj's underlying member method code with example usage: obj.test_property_assignment_template() without return types