~aelkner/schooltool/january_fixes

« back to all changes in this revision

Viewing changes to src/schooltool/app/browser/tests/test_app.py

  • Committer: Gediminas Paulauskas
  • Date: 2009-12-30 17:38:37 UTC
  • mfrom: (2532.1.44 schooltool_makefile)
  • Revision ID: menesis@pov.lt-20091230173837-tbvd13wlmvvochmo
Port to Zope versions available in Karmic (LP: #498803)

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
        >>> request = TestRequest(form={'username': 'frog',
201
201
        ...                             'password': 'pond',
202
202
        ...                             'nexturl': 'http://host/path',
203
 
        ...                             'LOGIN': 'Log in'})
 
203
        ...                             'LOGIN': 'Log in'},
 
204
        ...                       environ={'HTTP_HOST': 'host'})
204
205
        >>> request.setPrincipal(StubPrincipal())
205
206
        >>> view = View(app, request)
206
207
        >>> content = view()
211
212
        >>> request.response.getHeader('Location')
212
213
        'http://host/path'
213
214
 
 
215
    But we cannot specify a different server.
 
216
        >>> request = TestRequest(form={'username': 'frog',
 
217
        ...                             'password': 'pond',
 
218
        ...                             'nexturl': 'http://FAKE/path',
 
219
        ...                             'LOGIN': 'Log in'},
 
220
        ...                       environ={'HTTP_HOST': 'host'})
 
221
        >>> request.setPrincipal(StubPrincipal())
 
222
        >>> view = View(app, request)
 
223
        >>> content = view()
 
224
        Traceback (most recent call last):
 
225
        ...
 
226
        ValueError: Untrusted redirect to host 'FAKE' not allowed.
 
227
 
214
228
    """
215
229
 
216
230