Beispiel #1
0
 def test_not_authenticated(self):
     from mudwyrm.views.auth import forbidden
     from pyramid.httpexceptions import HTTPFound
     request = testing.DummyRequest()
     result = forbidden(request)
     self.assertIsInstance(result, HTTPFound)
     assert result.location.startswith('/login')
Beispiel #2
0
 def test_authenticated(self):
     from mudwyrm.views.auth import forbidden
     self.config.testing_securitypolicy(userid='foo', permissive=False)
     request = testing.DummyRequest()
     result = forbidden(request)
     self.assertEquals(result, {})