Improve unittest for key expiry dialog. Import testKey.