def test_get_current_request(self): self.assertEqual(get_current_request(), None) # tests default (None) request = RequestFactory().get(u'/') set_thread_variable('request', request) self.assertEqual(get_current_request(), request)
def tearDown(self): set_thread_variable('request', None)
def test_get_set_thread_variable(self): set_thread_variable('test', { 'test': 'test'}) gotten = get_thread_variable('test') self.assertEqual(gotten, { 'test': 'test'})
def setUp(self): set_thread_variable('request', None)