/shabti/templates/auth_rdfalchemy/+package+/tests/functional/test_auth_login.py_tmpl
Unknown | 61 lines | 59 code | 2 blank | 0 comment | 0 complexity | c3c4180c70ea4e4230a63c581602fd85 MD5 | raw file
1from datetime import datetime, timedelta
2import time
3import hashlib
4
5from pylons import url, config
6from {{package}}.model import *
7from {{package}}.tests import *
8
9class TestLoginController(TestController):
10 pass
11 # def setUp(self):
12 # TestModel.setUp(self)
13 #
14 #
15 # def tearDown(self):
16 # TestModel.tearDown(self)
17 #
18 #
19 # def test_admin_signin(self):
20 # """Ensure that signin is successful"""
21 # response = self.app.post(url(controller='login', action='signin'),
22 # params={'username':u'admin',
23 # 'password':"admin"})
24 #
25 # assert response.status_int == 302
26 #
27 # assert response.location == 'http://localhost/demo/privindex'
28 #
29 #
30 # def test_admin_signout(self):
31 # """Ensure that signout is successful."""
32 # response = self.app.get(url(controller='login', action='signout'))
33 #
34 # assert response.status_int == 302
35 #
36 # assert response.location == 'http://localhost/login/index'
37 #
38 #
39 # def test_unauthorised_model_access_is_prohibited(self):
40 # """Unauthorised GET access is prohibited."""
41 # response = self.app.get(url(controller='demo', action='privindex'))
42 #
43 # assert response.status_int == 302
44 # print(response.location)
45 # assert response.location == 'http://localhost/login/index'
46 #
47 # def test_authorised_model_access_is_permitted(self):
48 # """Authorised GET access is permitted."""
49 # response = self.app.post(url(controller='login', action='signin'),
50 # params={'username':u'admin',
51 # 'password':"admin"})
52 #
53 # assert response.status_int == 302
54 #
55 # assert response.location == 'http://localhost/demo/privindex'
56 #
57 # newresponse = response.follow()
58 #
59 # assert 'Welcome <span style="color:green">admin</span>.' in newresponse
60 #
61 #