/shabti/templates/auth_rdfalchemy/+package+/tests/functional/test_auth_login.py_tmpl
https://bitbucket.org/gawel/shabti · Unknown · 61 lines · 59 code · 2 blank · 0 comment · 0 complexity · c3c4180c70ea4e4230a63c581602fd85 MD5 · raw file
- from datetime import datetime, timedelta
- import time
- import hashlib
- from pylons import url, config
- from {{package}}.model import *
- from {{package}}.tests import *
- class TestLoginController(TestController):
- pass
- # def setUp(self):
- # TestModel.setUp(self)
- #
- #
- # def tearDown(self):
- # TestModel.tearDown(self)
- #
- #
- # def test_admin_signin(self):
- # """Ensure that signin is successful"""
- # response = self.app.post(url(controller='login', action='signin'),
- # params={'username':u'admin',
- # 'password':"admin"})
- #
- # assert response.status_int == 302
- #
- # assert response.location == 'http://localhost/demo/privindex'
- #
- #
- # def test_admin_signout(self):
- # """Ensure that signout is successful."""
- # response = self.app.get(url(controller='login', action='signout'))
- #
- # assert response.status_int == 302
- #
- # assert response.location == 'http://localhost/login/index'
- #
- #
- # def test_unauthorised_model_access_is_prohibited(self):
- # """Unauthorised GET access is prohibited."""
- # response = self.app.get(url(controller='demo', action='privindex'))
- #
- # assert response.status_int == 302
- # print(response.location)
- # assert response.location == 'http://localhost/login/index'
- #
- # def test_authorised_model_access_is_permitted(self):
- # """Authorised GET access is permitted."""
- # response = self.app.post(url(controller='login', action='signin'),
- # params={'username':u'admin',
- # 'password':"admin"})
- #
- # assert response.status_int == 302
- #
- # assert response.location == 'http://localhost/demo/privindex'
- #
- # newresponse = response.follow()
- #
- # assert 'Welcome <span style="color:green">admin</span>.' in newresponse
- #
- #