Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

Commit

Permalink
Use our own TestRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 20, 2012
1 parent 2e52a73 commit e5b6b24
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plone/z3cform/crud/README.txt
Expand Up @@ -57,7 +57,7 @@ Our simple form looks like this:
This is all that we need to render a combined edit add form containing
all our items:

>>> from z3c.form.testing import TestRequest
>>> from plone.z3cform.tests import TestRequest
>>> print MyForm(None, TestRequest())() \
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<div class="crud-form">...Martha...Peter...</div>
Expand Down
2 changes: 1 addition & 1 deletion plone/z3cform/fieldsets/README.txt
Expand Up @@ -38,7 +38,7 @@ set of fields directly on the form. This known as the default fieldset.
This form should work as-is, i.e. we can update it. First we need to fake a
request.

>>> from z3c.form.testing import TestRequest
>>> from plone.z3cform.tests import TestRequest

>>> request = TestRequest()
>>> request.other = {}
Expand Down
7 changes: 7 additions & 0 deletions plone/z3cform/tests.py
Expand Up @@ -10,10 +10,17 @@
import zope.traversing.namespace
import zope.publisher.interfaces.browser
import z3c.form.testing
from z3c.form.interfaces import IFormLayer
from zope.configuration import xmlconfig

import plone.z3cform.templates

from zope.publisher.browser import TestRequest


class TestRequest(TestRequest):
interface.implements(IFormLayer)


def create_eventlog(event=interface.Interface):
value = []
Expand Down
2 changes: 1 addition & 1 deletion plone/z3cform/textlines/textlines.txt
Expand Up @@ -18,7 +18,7 @@ interface:

The widget can be instantiated only using the request:

>>> from z3c.form.testing import TestRequest
>>> from plone.z3cform.tests import TestRequest
>>> request = TestRequest()

>>> widget = textlines.TextLinesWidget(request)
Expand Down

0 comments on commit e5b6b24

Please sign in to comment.