Commit bd02f2b1 authored by Fabien Morin's avatar Fabien Morin

add new test for password format. Work made by Jérome Perrin


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35682 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5344563a
......@@ -160,6 +160,18 @@ class TestPerson(ERP5TypeTestCase):
p.setPassword('secret')
self.assertTrue(p.getPassword())
def testPasswordFormat(self):
p = self._makeOne('person')
p._setEncodedPassword('pass_A', format='A')
p._setEncodedPassword('pass_B', format='B')
self.assertEquals('pass_A', p.getPassword(format='A'))
self.assertEquals('pass_B', p.getPassword(format='B'))
self.assertEquals(None, p.getPassword(format='unknown'))
self.assertEquals('default', p.getPassword('default', format='unknown'))
self.assertEquals(None, p.getPassword())
self.assertEquals('default', p.getPassword('default'))
def test_suite():
suite = unittest.TestSuite()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment