import unittest


class TagTest(unittest.TestCase):
    """Testing ..tag.Tag."""

    def test_from_code_generates_a_tag_object_equal_to_its_source(self):
        from ..tag import Tag
        tag = Tag(u'Vipraschül', 'Person')
        self.assertEqual(tag, Tag.from_code(tag.code))

import zeit.cms.interfaces
import zeit.retresco.testing


class TagTest(zeit.retresco.testing.FunctionalTestCase):
    """Testing ..tag.Tag."""

    def test_from_code_generates_a_tag_object_equal_to_its_source(self):
        from ..tag import Tag
        tag = Tag(u'Vipraschül', 'Person')
        self.assertEqual(tag, Tag.from_code(tag.code))

    def test_uniqueId_from_tag_can_be_adapted_to_tag(self):
        from ..tag import Tag
        tag = Tag(u'Vipraschül', 'Person')
        self.assertEqual(tag, zeit.cms.interfaces.ICMSContent(tag.uniqueId))

Test that adapter in `zeit.cms` handles unicode escaped uniqueId correctly.
ZON-3199: Test that adapter in `zeit.cms` handles unicode escaped uniqueId correctly.

- import unittest
+ import zeit.cms.interfaces
+ import zeit.retresco.testing
  
  
- class TagTest(unittest.TestCase):
+ class TagTest(zeit.retresco.testing.FunctionalTestCase):
      """Testing ..tag.Tag."""
  
      def test_from_code_generates_a_tag_object_equal_to_its_source(self):
          from ..tag import Tag
          tag = Tag(u'Vipraschül', 'Person')
          self.assertEqual(tag, Tag.from_code(tag.code))
  
+     def test_uniqueId_from_tag_can_be_adapted_to_tag(self):
+         from ..tag import Tag
+         tag = Tag(u'Vipraschül', 'Person')
+         self.assertEqual(tag, zeit.cms.interfaces.ICMSContent(tag.uniqueId))
+ 
Test that adapter in `zeit.cms` handles unicode escaped uniqueId correctly.
## Code Before:
import unittest


class TagTest(unittest.TestCase):
    """Testing ..tag.Tag."""

    def test_from_code_generates_a_tag_object_equal_to_its_source(self):
        from ..tag import Tag
        tag = Tag(u'Vipraschül', 'Person')
        self.assertEqual(tag, Tag.from_code(tag.code))

## Instruction:
Test that adapter in `zeit.cms` handles unicode escaped uniqueId correctly.
## Code After:
import zeit.cms.interfaces
import zeit.retresco.testing


class TagTest(zeit.retresco.testing.FunctionalTestCase):
    """Testing ..tag.Tag."""

    def test_from_code_generates_a_tag_object_equal_to_its_source(self):
        from ..tag import Tag
        tag = Tag(u'Vipraschül', 'Person')
        self.assertEqual(tag, Tag.from_code(tag.code))

    def test_uniqueId_from_tag_can_be_adapted_to_tag(self):
        from ..tag import Tag
        tag = Tag(u'Vipraschül', 'Person')
        self.assertEqual(tag, zeit.cms.interfaces.ICMSContent(tag.uniqueId))
