
import mock
import zeit.cms.tagging.tag


class TaggingHelper(object):
    """Mixin for tests which need some tagging infrastrucutre."""

    def get_tag(self, code):
        tag = zeit.cms.tagging.tag.Tag(code, code)
        tag.disabled = False
        return tag

    def setup_tags(self, *codes):
        import stabledict

        class Tags(stabledict.StableDict):
            pass
        tags = Tags()
        for code in codes:
            tags[code] = self.get_tag(code)
        patcher = mock.patch('zeit.cms.tagging.interfaces.ITagger')
        self.addCleanup(patcher.stop)
        self.tagger = patcher.start()
        self.tagger.return_value = tags
        tags.updateOrder = mock.Mock()
        tags.update = mock.Mock()
        return tags


import mock
import zeit.cms.tagging.tag


class TaggingHelper(object):
    """Mixin for tests which need some tagging infrastrucutre."""

    def get_tag(self, code):
        tag = zeit.cms.tagging.tag.Tag(code, code)
        return tag

    def setup_tags(self, *codes):
        import stabledict

        class Tags(stabledict.StableDict):
            pass
        tags = Tags()
        for code in codes:
            tags[code] = self.get_tag(code)
        patcher = mock.patch('zeit.cms.tagging.interfaces.ITagger')
        self.addCleanup(patcher.stop)
        self.tagger = patcher.start()
        self.tagger.return_value = tags
        tags.updateOrder = mock.Mock()
        tags.update = mock.Mock()
        return tags

Remove superfluous variable ('disabled' is a concept of zeit.intrafind and doesn't belong here)
Remove superfluous variable ('disabled' is a concept of zeit.intrafind and doesn't belong here)

  
  import mock
  import zeit.cms.tagging.tag
  
  
  class TaggingHelper(object):
      """Mixin for tests which need some tagging infrastrucutre."""
  
      def get_tag(self, code):
          tag = zeit.cms.tagging.tag.Tag(code, code)
-         tag.disabled = False
          return tag
  
      def setup_tags(self, *codes):
          import stabledict
  
          class Tags(stabledict.StableDict):
              pass
          tags = Tags()
          for code in codes:
              tags[code] = self.get_tag(code)
          patcher = mock.patch('zeit.cms.tagging.interfaces.ITagger')
          self.addCleanup(patcher.stop)
          self.tagger = patcher.start()
          self.tagger.return_value = tags
          tags.updateOrder = mock.Mock()
          tags.update = mock.Mock()
          return tags
  
Remove superfluous variable ('disabled' is a concept of zeit.intrafind and doesn't belong here)
## Code Before:

import mock
import zeit.cms.tagging.tag


class TaggingHelper(object):
    """Mixin for tests which need some tagging infrastrucutre."""

    def get_tag(self, code):
        tag = zeit.cms.tagging.tag.Tag(code, code)
        tag.disabled = False
        return tag

    def setup_tags(self, *codes):
        import stabledict

        class Tags(stabledict.StableDict):
            pass
        tags = Tags()
        for code in codes:
            tags[code] = self.get_tag(code)
        patcher = mock.patch('zeit.cms.tagging.interfaces.ITagger')
        self.addCleanup(patcher.stop)
        self.tagger = patcher.start()
        self.tagger.return_value = tags
        tags.updateOrder = mock.Mock()
        tags.update = mock.Mock()
        return tags

## Instruction:
Remove superfluous variable ('disabled' is a concept of zeit.intrafind and doesn't belong here)
## Code After:

import mock
import zeit.cms.tagging.tag


class TaggingHelper(object):
    """Mixin for tests which need some tagging infrastrucutre."""

    def get_tag(self, code):
        tag = zeit.cms.tagging.tag.Tag(code, code)
        return tag

    def setup_tags(self, *codes):
        import stabledict

        class Tags(stabledict.StableDict):
            pass
        tags = Tags()
        for code in codes:
            tags[code] = self.get_tag(code)
        patcher = mock.patch('zeit.cms.tagging.interfaces.ITagger')
        self.addCleanup(patcher.stop)
        self.tagger = patcher.start()
        self.tagger.return_value = tags
        tags.updateOrder = mock.Mock()
        tags.update = mock.Mock()
        return tags
