Skip to content

Commit

Permalink
add convenience-method to add the browser-layer to the request
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer committed Feb 11, 2014
1 parent 29f2e4b commit 81f39ee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plone/app/contenttypes/testing.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from plone.app.contenttypes.interfaces import IPloneAppContenttypesLayer
from plone.app.event.testing import PAEvent_FIXTURE
from plone.app.testing import PloneSandboxLayer
from plone.app.testing import applyProfile
Expand All @@ -10,10 +11,20 @@
from plone.app.testing import login
from plone.testing import z2
from zope.configuration import xmlconfig
from zope.interface import alsoProvides

import pkg_resources


def set_browserlayer(request):
"""Set the BrowserLayer for the request.
We have to set the browserlayer manually, since importing the profile alone
doesn't do it in tests.
"""
alsoProvides(request, IPloneAppContenttypesLayer)


class PloneAppContenttypes(PloneSandboxLayer):

defaultBases = (PAEvent_FIXTURE, PLONE_FIXTURE,)
Expand Down

0 comments on commit 81f39ee

Please sign in to comment.