code: def test_find_by_name(self):
      # test tag can be found
      tag = TagDAO.find_by_name("example_tag_1")
      assert tag is not None
      # tag that doesnt exist
      tag = TagDAO.find_by_name("invalid_tag_1")
      assert tag is None
      # tag was not created
      assert (
          db.session.query(Tag)
          .filter(Tag.name == "invalid_tag_1")
          .first()
          is None
      )
  
imports: from operator import and_
  from unittest.mock import patch
  import pytest
  from superset.daos.exceptions import DAOCreateFailedError, DAOException
  from superset.models.slice import Slice
  from superset.models.sql_lab import SavedQuery
  from superset.daos.tag import TagDAO
  from superset.tags.exceptions import InvalidTagNameError
  from superset.tags.models import ObjectType, Tag, TaggedObject
  from tests.integration_tests.tags.api_tests import TAGS_FIXTURE_COUNT
  import tests.integration_tests.test_app
  from superset import db, security_manager
  from superset.daos.dashboard import DashboardDAO
  from superset.models.dashboard import Dashboard
  from tests.integration_tests.base_tests import SupersetTestCase
  from tests.integration_tests.fixtures.world_bank_dashboard import load_world_bank_dashboard_with_slices, load_world_bank_data
  from tests.integration_tests.fixtures.tags import with_tagging_system_feature
label_desc: Use image node_id 9 for calling the TestTagsDAO obj's underlying member method code with example usage: obj.test_find_by_name() without return types