def test_to_json(self):
     s = PasswordSetting("unit.test")
     s.set_modification_date("2005-01-01T01:14:12")
     s.set_creation_date("2001-01-01T02:14:12")
     s.set_salt("something".encode('utf-8'))
     s.set_iterations(213)
     s.set_template("xxxxxxxxxxoxxx")
     s.set_extra_character_set("XVLCWKHGFQUIAEOSNRTDYÜÖÄPZBMJ")
     s.set_notes("Some note.")
     self.assertIn("domain", s.to_dict())
     self.assertEqual("unit.test", s.to_dict()["domain"])
     self.assertIn("cDate", s.to_dict())
     self.assertEqual("2001-01-01T02:14:12.000", s.to_dict()["cDate"])
     self.assertIn("mDate", s.to_dict())
     self.assertEqual("2005-01-01T01:14:12.000", s.to_dict()["mDate"])
     self.assertIn("salt", s.to_dict())
     self.assertEqual(str(b64encode("something".encode('utf-8')), encoding='utf-8'), s.to_dict()["salt"])
     self.assertIn("iterations", s.to_dict())
     self.assertEqual(213, s.to_dict()["iterations"])
     self.assertIn("passwordTemplate", s.to_dict())
     self.assertEqual("xxxxxxxxxxoxxx", s.to_dict()["passwordTemplate"])
     self.assertIn("extras", s.to_dict())
     self.assertEqual("XVLCWKHGFQUIAEOSNRTDYÜÖÄPZBMJ", s.to_dict()["extras"])
     self.assertIn("notes", s.to_dict())
     self.assertEqual("Some note.", s.to_dict()["notes"])
 def test_to_json(self):
     s = PasswordSetting("unit.test")
     s.set_modification_date("2005-01-01T01:14:12")
     s.set_creation_date("2001-01-01T02:14:12")
     s.set_salt("something".encode('utf-8'))
     s.set_iterations(213)
     s.set_length(14)
     s.set_custom_character_set("XVLCWKHGFQUIAEOSNRTDYÜÖÄPZBMJ")
     s.set_notes("Some note.")
     self.assertIn("domain", s.to_dict())
     self.assertEqual("unit.test", s.to_dict()["domain"])
     self.assertIn("cDate", s.to_dict())
     self.assertEqual("2001-01-01T02:14:12", s.to_dict()["cDate"])
     self.assertIn("mDate", s.to_dict())
     self.assertEqual("2005-01-01T01:14:12", s.to_dict()["mDate"])
     self.assertIn("salt", s.to_dict())
     self.assertEqual(str(b64encode("something".encode('utf-8')), encoding='utf-8'), s.to_dict()["salt"])
     self.assertIn("iterations", s.to_dict())
     self.assertEqual(213, s.to_dict()["iterations"])
     self.assertIn("length", s.to_dict())
     self.assertEqual(14, s.to_dict()["length"])
     self.assertIn("usedCharacters", s.to_dict())
     self.assertEqual("XVLCWKHGFQUIAEOSNRTDYÜÖÄPZBMJ", s.to_dict()["usedCharacters"])
     self.assertIn("notes", s.to_dict())
     self.assertEqual("Some note.", s.to_dict()["notes"])
 def test_set_modification_date(self):
     s = PasswordSetting("unit.test")
     s.set_creation_date("2007-01-01T02:14:12")
     s.set_modification_date("2005-01-01T01:14:12")
     self.assertEqual("2005-01-01T01:14:12.000", s.get_creation_date())
     self.assertEqual("2005-01-01T01:14:12.000", s.get_modification_date())
 def test_set_modification_date(self):
     s = PasswordSetting("unit.test")
     s.set_creation_date("2007-01-01T02:14:12")
     s.set_modification_date("2005-01-01T01:14:12")
     self.assertEqual("2005-01-01T01:14:12", s.get_creation_date())
     self.assertEqual("2005-01-01T01:14:12", s.get_modification_date())