Module ImportFrom alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias alias alias ImportFrom alias alias alias alias alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call NameLoad Call AttributeLoad Call NameLoad attr NameLoad Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Call AttributeLoad Call NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assert Call AttributeLoad NameLoad attr NameLoad NameLoad Assert UnaryOpNot Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad NameLoad Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assert UnaryOpNot Call NameLoad Str Expr Call NameLoad Assert Call NameLoad Str Expr Call NameLoad Assert UnaryOpNot Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Expr Call NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body FunctionDef arguments args NameParam defaults body Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Return Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call NameLoad decorator_list NameLoad Assign NameStore Call NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Expr Call NameLoad Call NameLoad Expr Call NameLoad Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assert Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assert UnaryOpNot Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assert Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad Assert CompareNotIn NameLoad AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad Assert CompareIn NameLoad AttributeLoad NameLoad attr Expr Call NameLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Assert CompareIn NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str FunctionDef arguments args NameParam defaults body Return Call NameLoad decorator_list Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad NameLoad Assert CompareNotIn NameLoad AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Return Call NameLoad decorator_list NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad NameLoad Assert CompareIn NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body FunctionDef arguments args defaults body Assert Call NameLoad decorator_list NameLoad Expr Call NameLoad Assert UnaryOpNot Call NameLoad Expr Call NameLoad Assert UnaryOpNot Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body FunctionDef arguments args defaults body Assert Call NameLoad decorator_list NameLoad Expr Call NameLoad Assert Call NameLoad Expr Call NameLoad Assert Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Assert UnaryOpNot Call NameLoad With NameLoad body Assert Call NameLoad Assert UnaryOpNot Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Assert Call NameLoad With NameLoad body Assert Call NameLoad Assert Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Assert UnaryOpNot Call NameLoad With Call AttributeLoad NameLoad attr NameLoad body With NameLoad body Assert Call NameLoad Raise NameLoad Assert UnaryOpNot Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Dict FunctionDef arguments args defaults body With NameLoad body Expr Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Num Call NameLoad decorator_list FunctionDef arguments args defaults body Expr Call NameLoad With NameLoad body Expr Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Num Call NameLoad decorator_list Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad decorator_list decorator_list
N/A threading Lock Thread django.http HttpRequest HttpResponse django.test TestCase nose.tools eq_ multidb DEFAULT_DB_ALIAS MasterSlaveRouter PinningMasterSlaveRouter get_slave multidb.middleware PINNING_COOKIE PINNING_SECONDS PinningRouterMiddleware multidb.pinning this_thread_is_pinned pin_this_thread unpin_this_thread use_master db_write UnpinningTestCase N/A TestCase N/A N/A Test case that unpins the thread on tearDown tearDown N/A N/A self N/A N/A N/A N/A unpin_this_thread N/A N/A MasterSlaveRouterTests N/A TestCase N/A N/A Tests for MasterSlaveRouter test_db_for_read N/A N/A self N/A N/A N/A N/A eq_ N/A N/A N/A MasterSlaveRouter db_for_read None N/A get_slave N/A test_db_for_write N/A N/A self N/A N/A N/A N/A eq_ N/A N/A N/A MasterSlaveRouter db_for_write None DEFAULT_DB_ALIAS N/A test_allow_syncdb N/A N/A self N/A N/A N/A Make sure allow_syncdb() does the right thing for both masters and
        slaves N/A router N/A MasterSlaveRouter N/A N/A N/A router allow_syncdb DEFAULT_DB_ALIAS None N/A N/A N/A N/A router allow_syncdb N/A get_slave None N/A N/A SettingsTests N/A TestCase N/A N/A Tests for settings defaults test_cookie_default N/A N/A self N/A N/A N/A Check that the cookie name has the right default. N/A N/A eq_ PINNING_COOKIE multidb_pin_writes N/A test_pinning_seconds_default N/A N/A self N/A N/A N/A Make sure the cookie age has the right default. N/A N/A eq_ PINNING_SECONDS 15 N/A N/A PinningTests N/A UnpinningTestCase N/A N/A Tests for "pinning" functionality, above and beyond what's inherited
    from MasterSlaveRouter test_pinning_encapsulation N/A N/A self N/A N/A N/A Check the pinning getters and setters. N/A N/A N/A this_thread_is_pinned Thread started out pinned or this_thread_is_pinned() is broken. N/A N/A pin_this_thread N/A N/A this_thread_is_pinned pin_this_thread() didn't pin the thread. N/A N/A unpin_this_thread N/A N/A N/A this_thread_is_pinned Thread remained pinned after unpin_this_thread(). N/A test_pinned_reads N/A N/A self N/A N/A N/A Test PinningMasterSlaveRouter.db_for_read() when pinned and when
        not. N/A router N/A PinningMasterSlaveRouter N/A N/A eq_ N/A N/A router db_for_read None N/A get_slave N/A N/A pin_this_thread N/A N/A eq_ N/A N/A router db_for_read None DEFAULT_DB_ALIAS N/A test_db_write_decorator N/A N/A self N/A N/A read_view N/A N/A req N/A N/A N/A N/A eq_ N/A N/A router db_for_read None N/A get_slave N/A N/A HttpResponse N/A write_view N/A N/A req N/A N/A N/A N/A eq_ N/A N/A router db_for_read None DEFAULT_DB_ALIAS N/A N/A HttpResponse N/A db_write N/A router N/A PinningMasterSlaveRouter N/A N/A eq_ N/A N/A router db_for_read None N/A get_slave N/A N/A write_view N/A HttpRequest N/A N/A read_view N/A HttpRequest N/A N/A MiddlewareTests N/A UnpinningTestCase N/A N/A Tests for the middleware that supports pinning setUp N/A N/A self N/A N/A N/A N/A N/A N/A super MiddlewareTests self setUp N/A N/A self request N/A HttpRequest N/A N/A self middleware N/A PinningRouterMiddleware N/A test_pin_on_cookie N/A N/A self N/A N/A N/A Thread should pin when the cookie is set. N/A N/A N/A N/A self request COOKIES N/A PINNING_COOKIE y N/A N/A N/A N/A self middleware process_request N/A self request N/A N/A this_thread_is_pinned N/A test_unpin_on_no_cookie N/A N/A self N/A N/A N/A Thread should unpin when cookie is absent and method is GET. N/A N/A pin_this_thread N/A N/A N/A self request method GET N/A N/A N/A N/A self middleware process_request N/A self request N/A N/A N/A this_thread_is_pinned N/A test_pin_on_post N/A N/A self N/A N/A N/A Thread should pin when method is POST. N/A N/A N/A self request method POST N/A N/A N/A N/A self middleware process_request N/A self request N/A N/A this_thread_is_pinned N/A test_process_response N/A N/A self N/A N/A N/A Make sure the cookie gets set on POSTs but not GETs. N/A N/A N/A self request method GET N/A response N/A N/A N/A self middleware process_response N/A self request N/A HttpResponse N/A N/A PINNING_COOKIE N/A response cookies N/A N/A N/A self request method POST N/A response N/A N/A N/A self middleware process_response N/A self request N/A HttpResponse N/A N/A PINNING_COOKIE N/A response cookies N/A N/A eq_ N/A N/A N/A response cookies N/A PINNING_COOKIE N/A max-age PINNING_SECONDS N/A test_attribute N/A N/A self N/A N/A N/A The cookie should get set if the _db_write attribute is True. N/A res N/A HttpResponse N/A N/A res _db_write True N/A response N/A N/A N/A self middleware process_response N/A self request res N/A N/A PINNING_COOKIE N/A response cookies N/A test_db_write_decorator N/A N/A self N/A N/A N/A The @db_write decorator should make any view set the cookie. N/A req N/A self request N/A N/A req method GET view N/A N/A req N/A N/A N/A N/A HttpResponse N/A N/A response N/A N/A N/A self middleware process_response req N/A view req N/A N/A PINNING_COOKIE N/A response cookies write_view N/A N/A req N/A N/A N/A N/A HttpResponse N/A db_write N/A response N/A N/A N/A self middleware process_response req N/A write_view req N/A N/A PINNING_COOKIE N/A response cookies N/A N/A UseMasterTests N/A TestCase N/A test_decorator N/A N/A self N/A N/A check N/A N/A N/A N/A N/A N/A this_thread_is_pinned N/A use_master N/A N/A unpin_this_thread N/A N/A N/A this_thread_is_pinned N/A N/A check N/A N/A N/A this_thread_is_pinned N/A test_decorator_resets N/A N/A self N/A N/A check N/A N/A N/A N/A N/A N/A this_thread_is_pinned N/A use_master N/A N/A pin_this_thread N/A N/A this_thread_is_pinned N/A N/A check N/A N/A this_thread_is_pinned N/A test_context_manager N/A N/A self N/A N/A N/A N/A unpin_this_thread N/A N/A N/A this_thread_is_pinned N/A use_master N/A N/A N/A this_thread_is_pinned N/A N/A N/A this_thread_is_pinned N/A test_context_manager_resets N/A N/A self N/A N/A N/A N/A pin_this_thread N/A N/A this_thread_is_pinned N/A use_master N/A N/A N/A this_thread_is_pinned N/A N/A this_thread_is_pinned N/A test_context_manager_exception N/A N/A self N/A N/A N/A N/A unpin_this_thread N/A N/A N/A this_thread_is_pinned N/A N/A N/A self assertRaises ValueError N/A N/A use_master N/A N/A N/A this_thread_is_pinned N/A ValueError N/A N/A N/A this_thread_is_pinned N/A test_multithreaded_unpinning N/A N/A self N/A N/A N/A thread1_lock N/A Lock N/A thread2_lock N/A Lock N/A N/A N/A thread1_lock acquire N/A N/A N/A thread2_lock acquire N/A pinned N/A thread1_worker N/A N/A N/A N/A N/A use_master N/A N/A N/A N/A thread1_lock acquire N/A N/A pinned N/A 1 N/A this_thread_is_pinned N/A thread2_worker N/A N/A N/A N/A N/A N/A pin_this_thread N/A use_master N/A N/A N/A N/A thread2_lock acquire N/A N/A pinned N/A 2 N/A this_thread_is_pinned N/A N/A thread1 N/A Thread target thread1_worker N/A thread2 N/A Thread target thread2_worker N/A N/A N/A thread1 start N/A N/A N/A thread2 start N/A N/A N/A thread2_lock release N/A N/A N/A thread2 join N/A N/A N/A self assertEqual N/A pinned N/A 2 True N/A N/A N/A thread1_lock release N/A N/A N/A thread1 join N/A N/A N/A self assertEqual N/A pinned N/A 1 False N/A N/A