In [1]: from django.test.client import Client
In [2]: c=Client()
In [3]: f=c.post('/login/',{'username':'jian.shi','password':'111111'})
In [4]: f.status_code
200
In [5]: f=c.get('/contract/index/')
In [6]: f.status_code
302
In [7]: f=c.get('/charge/index/')
In [8]: f.status_code
302
In [9]: c.login(username='jian.shi',password='111111')
True
In [10]: f=c.get('/charge/index/')
In [11]: f.status_code
200
In [12]: f=c.get('/contract/index/')
In [13]: f.status_code
200