def test_invalid_key_decrypt(self):
        """Test that decrypt_str fails when using the wrong key"""
        eh = EncryptHelper(EncryptHelper.generate_key())
        enc = eh.encrypt_str(self.txt)
        # Make sure we can actually decrypt the data when using the original key
        self.assertEqual(eh.decrypt_str(enc), self.txt)

        # Now with a different key, decrypt_str should throw EncryptionError
        eh2 = EncryptHelper(EncryptHelper.generate_key())
        with self.assertRaises(EncryptionError):
            eh2.decrypt_str(enc)
    def test_generate_key_enc_dec(self):
        """Test :py:meth:`.EncryptHelper.generate_key` key works for encryption and decryption"""
        key = EncryptHelper.generate_key()
        self.assertIs(type(key), str)
        eh = EncryptHelper(key)
        
        enc = eh.encrypt_str(self.txt)

        self.assertIs(type(enc), str)
        self.assertNotEqual(enc, self.txt)

        dec = eh.decrypt_str(enc)
        self.assertEqual(dec, self.txt)