docstr: Annotation Api: Test update annotation layer uniqueness
docstr_tok: ["Annotation","Api",":","Test","update","annotation","layer","uniqueness"]
code: def test_update_annotation_layer_uniqueness(self):
      """
      Annotation Api: Test update annotation layer uniqueness
      """
      annotation_layer = (
          db.session.query(AnnotationLayer)
          .filter(AnnotationLayer.name == "name2")
          .one_or_none()
      )
  
      self.login(username="admin")
      annotation_layer_data = {
          "name": "name3",
          "descr": "changed_description",
      }
      uri = f"api/v1/annotation_layer/{annotation_layer.id}"
      rv = self.client.put(uri, json=annotation_layer_data)
      data = json.loads(rv.data.decode("utf-8"))
      assert rv.status_code == 422
      assert data == {"message": {"name": ["Name must be unique"]}}
  
imports: import json
  import pytest
  import prison
  from sqlalchemy.sql import func
  import tests.integration_tests.test_app
  from superset import db
  from superset.models.annotations import Annotation, AnnotationLayer
  from tests.integration_tests.base_tests import SupersetTestCase
  from tests.integration_tests.annotation_layers.fixtures import create_annotation_layers, get_end_dttm, get_start_dttm
  from tests.unit_tests.annotation_layers.fixtures import START_STR, END_STR
label_desc: Use image node_id 13 for calling the TestAnnotationLayerApi obj's underlying member method code with example usage: obj.test_update_annotation_layer_uniqueness() without return types