import pkg_resources
import zeit.cms.testing


product_config = """\
<product-config zeit.today>
    today-xml-url file://{base}/today.xml
</product-config>
""".format(base=pkg_resources.resource_filename(__name__, '.'))

TodayLayer = zeit.cms.testing.ZCMLLayer('ftesting.zcml', product_config=(
    product_config +
    zeit.cms.testing.cms_product_config))


def test_suite():
    return zeit.cms.testing.FunctionalDocFileSuite(
        'README.txt',
        'yesterday.txt',
        layer=TodayLayer
    )

import pkg_resources
import zeit.cms.testing


product_config = """\
<product-config zeit.today>
    today-xml-url file://{base}/today.xml
</product-config>
""".format(base=pkg_resources.resource_filename(__name__, '.'))

CONFIG_LAYER = zeit.cms.testing.ProductConfigLayer(product_config, bases=(
    zeit.cms.testing.CONFIG_LAYER,))
ZCML_LAYER = zeit.cms.testing.ZCMLLayer(bases=(CONFIG_LAYER,))
ZOPE_LAYER = zeit.cms.testing.ZopeLayer(bases=(ZCML_LAYER,))


def test_suite():
    return zeit.cms.testing.FunctionalDocFileSuite(
        'README.txt',
        'yesterday.txt',
        layer=ZOPE_LAYER)

Update to new testlayer API
ZON-5241: Update to new testlayer API

  import pkg_resources
  import zeit.cms.testing
  
  
  product_config = """\
  <product-config zeit.today>
      today-xml-url file://{base}/today.xml
  </product-config>
  """.format(base=pkg_resources.resource_filename(__name__, '.'))
  
- TodayLayer = zeit.cms.testing.ZCMLLayer('ftesting.zcml', product_config=(
-     product_config +
-     zeit.cms.testing.cms_product_config))
+ CONFIG_LAYER = zeit.cms.testing.ProductConfigLayer(product_config, bases=(
+     zeit.cms.testing.CONFIG_LAYER,))
+ ZCML_LAYER = zeit.cms.testing.ZCMLLayer(bases=(CONFIG_LAYER,))
+ ZOPE_LAYER = zeit.cms.testing.ZopeLayer(bases=(ZCML_LAYER,))
  
  
  def test_suite():
      return zeit.cms.testing.FunctionalDocFileSuite(
          'README.txt',
          'yesterday.txt',
+         layer=ZOPE_LAYER)
-         layer=TodayLayer
-     )
  
Update to new testlayer API
## Code Before:
import pkg_resources
import zeit.cms.testing


product_config = """\
<product-config zeit.today>
    today-xml-url file://{base}/today.xml
</product-config>
""".format(base=pkg_resources.resource_filename(__name__, '.'))

TodayLayer = zeit.cms.testing.ZCMLLayer('ftesting.zcml', product_config=(
    product_config +
    zeit.cms.testing.cms_product_config))


def test_suite():
    return zeit.cms.testing.FunctionalDocFileSuite(
        'README.txt',
        'yesterday.txt',
        layer=TodayLayer
    )

## Instruction:
Update to new testlayer API
## Code After:
import pkg_resources
import zeit.cms.testing


product_config = """\
<product-config zeit.today>
    today-xml-url file://{base}/today.xml
</product-config>
""".format(base=pkg_resources.resource_filename(__name__, '.'))

CONFIG_LAYER = zeit.cms.testing.ProductConfigLayer(product_config, bases=(
    zeit.cms.testing.CONFIG_LAYER,))
ZCML_LAYER = zeit.cms.testing.ZCMLLayer(bases=(CONFIG_LAYER,))
ZOPE_LAYER = zeit.cms.testing.ZopeLayer(bases=(ZCML_LAYER,))


def test_suite():
    return zeit.cms.testing.FunctionalDocFileSuite(
        'README.txt',
        'yesterday.txt',
        layer=ZOPE_LAYER)
