old_contents: from zeit.cms.testcontenttype.testcontenttype import ExampleContentType
  import mock
  import zeit.push.interfaces
  import zeit.push.testing
  import zope.component
  
  
  class RetractBannerTest(zeit.cms.testing.BrowserTestCase):
  
      layer = zeit.push.testing.LAYER
  
      def setUp(self):
          super(RetractBannerTest, self).setUp()
          content = ExampleContentType()
          self.repository['homepage'] = content
          notifier = zope.component.getUtility(
              zeit.push.interfaces.IPushNotifier, name='homepage')
          notifier.uniqueId = content.uniqueId
  
      def tearDown(self):
          notifier = zope.component.getUtility(
              zeit.push.interfaces.IPushNotifier, name='homepage')
          del notifier.uniqueId
          super(RetractBannerTest, self).tearDown()
  
      def test_renders_url_for_each_banner(self):
          b = self.browser
          with mock.patch(
                  'zeit.push.browser.banner.Retract.banner_matches', new=True):
              b.open('http://localhost/++skin++vivi/@@breaking-banner-retract')
          self.assertEllipsis("""\
              ...cms:context=".../repository/homepage"...""", b.contents)
  
new_contents: from zeit.cms.testcontenttype.testcontenttype import ExampleContentType
  import mock
  import zeit.push.testing
  
  
  class RetractBannerTest(zeit.cms.testing.BrowserTestCase):
  
      layer = zeit.push.testing.LAYER
  
      def setUp(self):
          super(RetractBannerTest, self).setUp()
          # production uses a rawxml object, but we can cheat here.
          self.repository['banner'] = ExampleContentType()
  
      def test_renders_url_for_each_banner(self):
          b = self.browser
          with mock.patch(
                  'zeit.push.browser.banner.Retract.banner_matches', new=True):
              b.open('http://localhost/++skin++vivi/@@breaking-banner-retract')
          self.assertEllipsis("""\
              ...cms:context=".../repository/banner"...""", b.contents)
  
subject: Fix test setup