Back to index

moin  1.9.0~rc2
Public Member Functions | Static Public Attributes
test_auth.TestNoAuth Class Reference
Inheritance diagram for test_auth.TestNoAuth:
Inheritance graph
[legend]
Collaboration diagram for test_auth.TestNoAuth:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testNoAuth
def setup_class
def teardown_class
def run_request

Static Public Attributes

list PAGES = ['FrontPage', 'MoinMoin', 'HelpContents', 'WikiSandBox', ]

Detailed Description

Definition at line 39 of file test_auth.py.


Member Function Documentation

def test_auth.AuthTest.run_request (   self,
  params 
) [inherited]

Definition at line 30 of file test_auth.py.

00030 
00031     def run_request(self, **params):
00032         request = TestRequest(**params)
00033         #XXX: config passing hack
00034         request.given_config = getattr(self, 'Config', wikiconfig.Config)
00035         context = wsgiapp.init(request)
00036         wsgiapp.run(context)
00037         return context
00038 

Here is the caller graph for this function:

def test_auth.AuthTest.setup_class (   cls) [inherited]
Stuff that should be run to init the state of this test class

Some test needs specific config values, or they will fail.

Definition at line 19 of file test_auth.py.

00019 
00020     def setup_class(cls):
00021         """ Stuff that should be run to init the state of this test class
00022 
00023         Some test needs specific config values, or they will fail.
00024         """

def test_auth.AuthTest.teardown_class (   cls) [inherited]
Stuff that should run to clean up the state of this test class

Definition at line 25 of file test_auth.py.

00025 
00026     def teardown_class(cls):
00027         """ Stuff that should run to clean up the state of this test class
00028 
00029         """

run a simple request, no auth, just check if it succeeds 

Definition at line 40 of file test_auth.py.

00040 
00041     def testNoAuth(self):
00042         """ run a simple request, no auth, just check if it succeeds """
00043         request = self.run_request()
00044 
00045         # anon user?
00046         assert not request.user.valid
00047 
00048         appiter, status, headers = evaluate_request(request.request)
00049         # check if the request resulted in normal status, result headers and content
00050         assert status[:3] == '200'
00051         has_ct = has_v = has_cc = False
00052         for k, v in headers:
00053             if k == 'Content-Type':
00054                 assert v.startswith('text/html')
00055                 has_ct = True
00056             elif k == 'Vary':
00057                 assert 'Cookie' in v
00058                 assert 'Accept-Language' in v
00059                 has_v = True
00060             elif k == 'Cache-Control':
00061                 assert 'public' in v
00062                 has_cc = True
00063             elif k == 'Set-Cookie':
00064                 cookie = v
00065         assert has_ct
00066         assert has_v
00067         # XXX BROKEN?:
00068         #assert has_cc # cache anon user's content
00069         assert '</html>' in ''.join(appiter)

Here is the call graph for this function:


Member Data Documentation

list test_auth.AuthTest.PAGES = ['FrontPage', 'MoinMoin', 'HelpContents', 'WikiSandBox', ] [static, inherited]

Definition at line 17 of file test_auth.py.


The documentation for this class was generated from the following file: