add osusers.tests.test_models.ShadowTest
This commit is contained in:
parent
20f5686d85
commit
c270a6087e
1 changed files with 10 additions and 0 deletions
|
@ -117,6 +117,16 @@ class ShadowTest(TestCaseWithCeleryTasks):
|
|||
shadow = Shadow(user=user)
|
||||
self.assertEqual(str(shadow), 'for user test (1000)')
|
||||
|
||||
def test_set_password(self):
|
||||
group = Group.objects.create(
|
||||
groupname='test', gid=1000)
|
||||
user = User.objects.create(
|
||||
username='test', uid=1000, group=group, homedir='/home/test',
|
||||
shell='/bin/bash')
|
||||
shadow = Shadow(user=user)
|
||||
shadow.set_password('test')
|
||||
self.assertTrue(sha512_crypt.verify('test', shadow.passwd))
|
||||
|
||||
|
||||
TEST_TASK_UUID = '3120f6a8-2665-4fa3-a785-79efd28bfe92'
|
||||
TEST_TASK_NAME = 'test.task'
|
||||
|
|
Loading…
Reference in a new issue