def test_load_signature(self): ui = UserInfo("jdoe", "John Doe", ["admin", "power"]) self.assertNotEqual(ui.load_signature, None) self.assertFalse(ui.hasChanged()) ui.realname = "Luke Murphey" self.assertTrue(ui.hasChanged())
def test_signature_change_with_login_time(self): ui = UserInfo("jdoe", "John Doe", ["admin", "power"]) self.assertFalse(ui.hasChanged()) ui.updateLastLogin() self.assertTrue(ui.hasChanged()) ui.updateLoadSignature() self.assertFalse(ui.hasChanged()) # Let the time change a bit by sleeping a bit time.sleep(2) ui.updateLastLogin() self.assertTrue(ui.hasChanged())