Changeset 2608 in products for quintagroup.gauth/trunk/quintagroup/gauth/tests.py
- Timestamp:
- Jul 2, 2010 12:20:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.gauth/trunk/quintagroup/gauth/tests.py
r2607 r2608 9 9 from Products.PloneTestCase import PloneTestCase as ptc 10 10 from Products.PloneTestCase.layer import PloneSite 11 from Products.PloneTestCase.PloneTestCase import portal_owner 12 from Products.PloneTestCase.PloneTestCase import default_password 13 11 14 ptc.setupPloneSite() 12 15 … … 61 64 62 65 66 class TestConfiglet(FunctionalTestCase): 67 68 def afterSetUp(self): 69 self.loginAsPortalOwner() 70 self.addProduct("quintagroup.gauth") 71 self.basic_auth = portal_owner + ":" + default_password 72 self.get_url = self.portal.id+'/@@gauth-controlpanel' 73 self.save_url = self.portal.id+'/@@gauth-controlpanel?form.actions.save=1' \ 74 '&_authenticator=%s' % self._getauth() 75 76 def test_presentEmail(self): 77 res = self.publish(self.get_url, self.basic_auth).getBody() 78 self.assert_(re.match(".*<input\s[^>]*name=\"form.gauth_email\"[^>]*>", res, re.I|re.S)) 79 80 def test_presentPassword(self): 81 res = self.publish(self.get_url, self.basic_auth).getBody() 82 self.assert_(re.match(".*<input\s[^>]*name=\"form.gauth_pass\"[^>]*>", res, re.I|re.S)) 83 84 def test_update(self): 85 temail, tpass = "tester@test.com", "secret" 86 from quintagroup.gauth.interfaces import IGAuthInterface 87 from zope.component import queryUtility 88 gauth_util = queryUtility(IGAuthInterface) 89 gauth_util.gconf_init(self.portal, self.portal.REQUEST) 90 url = self.save_url + '&form.gauth_email='+temail + '&form.gauth_pass='+tpass 91 self.publish(url, self.basic_auth) 92 self.assert_(gauth_util.email == temail) 93 self.assert_(gauth_util.password == tpass) 94 95 63 96 def test_suite(): 64 97 from unittest import TestSuite, makeSuite 65 98 suite = TestSuite() 66 99 suite.addTest(makeSuite(TestInstall)) 100 suite.addTest(makeSuite(TestConfiglet)) 67 101 return suite 68 102
Note: See TracChangeset
for help on using the changeset viewer.