Commits

Rodrigo Bistolfi committed 6c798c8 Merge

Merged in m0e_lnx/m0e-vinstall (pull request #8)

Tests for hashed password added

Comments (0)

Files changed (1)

vinstall/backend/users.py

         self.fakeuser.login = "fakeuser"
         self.fakeuser.password = "fakepass"
         self.fakeuser._root = self.root
+	self.fakeadmin = User()
+	self.fakeadmin.password = "fakepassword"
 
     def test_user_created(self):
         self.fakeuser.create()
         self.assertEqual(ruser.login, self.fakeuser.login)
         self.fakeuser.delete()
 
+    def test_hashed_passwords(self):
+	hash1 = self.fakeuser.encrypt_password(self.fakeuser.password)
+	hash2 = self.fakeadmin.encrypt_password(self.fakeadmin.password)
+	self.assertNotEqual(hash1, hash2)
+
 
 if __name__ == '__main__':
     assert os.getuid() == 0, "Must be root to run these tests"