Package trac :: Package web :: Package tests :: Module session :: Class SessionTestCase

Class SessionTestCase

source code

       object --+    
                |    
unittest.TestCase --+
                    |
                   SessionTestCase

Unit tests for the persistent session support.
Nested Classes

Inherited from unittest.TestCase: failureException

Instance Methods
 
setUp(self)
Hook method for setting up the test fixture before exercising it.
source code
 
tearDown(self)
Hook method for deconstructing the test fixture after testing it.
source code
 
test_new_session(self)
Verify that a session cookie gets sent back to the client for a new session.
source code
 
test_anonymous_session(self)
Verify that session variables are stored in the database.
source code
 
test_authenticated_session(self)
Verifies that a session cookie does not get used if the user is logged in, and that Trac expires the cookie.
source code
 
test_session_promotion(self)
Verifies that an existing anonymous session gets promoted to an authenticated session when the user logs in.
source code
 
test_new_session_promotion(self)
Verifies that even without a preexisting anonymous session, an authenticated session will be created when the user logs in.
source code
 
test_add_anonymous_session_var(self)
Verify that new variables are inserted into the 'session' table in the database for an anonymous session.
source code
 
test_modify_anonymous_session_var(self)
Verify that modifying an existing variable updates the 'session' table accordingly for an anonymous session.
source code
 
test_delete_anonymous_session_var(self)
Verify that modifying a variable updates the 'session' table accordingly for an anonymous session.
source code
 
test_purge_anonymous_session(self)
Verify that old sessions get purged.
source code
 
test_delete_empty_session(self)
Verify that a session gets deleted when it doesn't have any data except for the 'last_visit' timestamp.
source code
 
test_change_anonymous_session(self)
Verify that changing from one anonymous session to an inexisting anonymous session creates the new session and doesn't carry over variables from the previous session.
source code
 
test_add_authenticated_session_var(self)
Verify that new variables are inserted into the 'session' table in the database for an authenticated session.
source code
 
test_modify_authenticated_session_var(self)
Verify that modifying an existing variable updates the 'session' table accordingly for an authenticated session.
source code
 
test_authenticated_session_independence_var(self)
Verify that an anonymous session with the same name as an authenticated session doesn't interfere with the latter.
source code
 
test_delete_authenticated_session_var(self)
Verify that deleting a variable updates the 'session' table accordingly for an authenticated session.
source code
 
test_update_session(self)
Verify that accessing a session after one day updates the sessions 'last_visit' variable so that the session doesn't get purged.
source code
 
test_modify_detached_session(self)
Verify that modifying a variable in a session not associated with a request updates the database accordingly.
source code
 
test_delete_detached_session_var(self)
Verify that removing a variable in a session not associated with a request deletes the variable from the database.
source code
 
test_session_admin_list(self) source code
 
test_session_admin_add(self) source code
 
test_session_admin_set(self) source code
 
test_session_admin_delete(self) source code
 
test_session_admin_purge(self) source code

Inherited from unittest.TestCase: __call__, __init__, __repr__, __str__, assertAlmostEqual, assertAlmostEquals, assertEqual, assertEquals, assertFalse, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertRaises, assertTrue, assert_, countTestCases, debug, defaultTestResult, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, shortDescription

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties

Inherited from object: __class__

Method Details

setUp(self)

source code 
Hook method for setting up the test fixture before exercising it.
Overrides: unittest.TestCase.setUp
(inherited documentation)

tearDown(self)

source code 
Hook method for deconstructing the test fixture after testing it.
Overrides: unittest.TestCase.tearDown
(inherited documentation)

test_new_session_promotion(self)

source code 
Verifies that even without a preexisting anonymous session, an authenticated session will be created when the user logs in. (same test as above without the initial INSERT)