【发布时间】:2011-11-22 01:26:39
【问题描述】:
我想从测试中读取一些会话变量 (Django TestCase)
如何以干净的方式做到这一点?
def test_add_docs(self):
"""
Test add docs
"""
# I would access to the session here:
self.request.session['documents_to_share_ids'] = [1]
response = self.client.get(reverse(self.document_add_view_id, args=[1]), follow=True)
self.assertEquals(response.status_code, 200)
【问题讨论】: