class_docstr: Test that the transform integrates well with QNodes.
docstr: Test that a Projector is queued when postselection is requested
  on a mid-circuit measurement
docstr_tok: ["Test","that","a","Projector","is","queued","when","postselection","is","requested","on","a","mid-circuit","measurement"]
code: def test_postselection_qnode(self, phi, shots):
      """Test that a Projector is queued when postselection is requested
      on a mid-circuit measurement"""
      dev = DefaultQubit()
  
      @qml.qnode(dev)
      @qml.defer_measurements
      def circ1(phi):
          qml.RX(phi, wires=0)
          # Postselecting on |1> on wire 0 means that the probability of measuring
          # |1> on wire 0 is 1
          m = qml.measure(0, postselect=1)
          qml.cond(m, qml.PauliX)(wires=1)
          # Probability of measuring |1> on wire 1 should be 1
          return qml.probs(wires=1)
  
      assert np.allclose(circ1(phi, shots=shots), [0, 1])
  
      expected_circuit = [
          qml.RX(phi, 0),
          qml.Projector([1], wires=0),
          qml.CNOT([0, 1]),
          qml.probs(wires=1),
      ]
  
      for op, expected_op in zip(circ1.qtape, expected_circuit):
          assert qml.equal(op, expected_op)
  
imports: import math
  import pytest
  import pennylane
  from pennylane.measurements import MidMeasureMP, MeasurementValue
  import pennylane.numpy
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 6 for calling the TestQNode obj's underlying member method code with example usage: obj.test_postselection_qnode(phi, shots) and returns: qml