def test_safe_summary(self): # Setup hasher = DrupalPasswordHasher() password = '******' encoded = hasher.encode(password, hasher.salt()) # Run & check summary_dict = hasher.safe_summary(encoded) assert summary_dict['algorithm'] == 'drupal' assert summary_dict['iterations'] > 0 assert len(summary_dict['salt']) == 8 assert len(summary_dict['hash']) == hasher._DRUPAL_HASH_LENGTH - 12