/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

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