summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-21 14:12:50 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-21 14:12:50 (GMT)
commit0ca1f3b647799f5aba4a817dedb5fecf25e47a6f (patch)
tree2f214812c7a847c1a0ba37c00d63601698ca7d5f
parente4efa7e85770c62299f2c39dff78dafd523c70b7 (diff)
Fix autotest
-rw-r--r--messagecomposer/autotests/CMakeLists.txt1
-rw-r--r--messagecomposer/autotests/messagefactorytest.cpp10
2 files changed, 7 insertions, 4 deletions
diff --git a/messagecomposer/autotests/CMakeLists.txt b/messagecomposer/autotests/CMakeLists.txt
index 496b21e..9dcf2ec 100644
--- a/messagecomposer/autotests/CMakeLists.txt
+++ b/messagecomposer/autotests/CMakeLists.txt
@@ -22,6 +22,7 @@ macro( add_messagecomposer_cryptotest _source )
KF5::MessageComposer
KF5::MessageViewer
KF5::MessageCore
+ KF5::TemplateParser
KF5::Libkleo
KF5::Libkdepim
KF5::PimTextEdit
diff --git a/messagecomposer/autotests/messagefactorytest.cpp b/messagecomposer/autotests/messagefactorytest.cpp
index fc4615f..bd5e4cf 100644
--- a/messagecomposer/autotests/messagefactorytest.cpp
+++ b/messagecomposer/autotests/messagefactorytest.cpp
@@ -21,6 +21,7 @@
#include "messagefactorytest.h"
#include "cryptofunctions.h"
+#include "globalsettings_templateparser.h"
#include <MessageCore/StringUtil>
#include <MessageCore/NodeHelper>
@@ -163,22 +164,23 @@ void MessageFactoryTest::testCreateReplyHtml()
KMime::Message::Ptr msg = loadMessageFromFile(QStringLiteral("html_utf8_encoded.mbox"));
KIdentityManagement::IdentityManager *identMan = new KIdentityManagement::IdentityManager;
- qDebug() << "html message:" << msg->encodedContent();
+ //qDebug() << "html message:" << msg->encodedContent();
MessageFactory factory(msg, 0);
factory.setIdentityManager(identMan);
+ TemplateParser::TemplateParserSettings::self()->setReplyUsingHtml(true);
MessageFactory::MessageReply reply = factory.createReply();
reply.replyAll = true;
- qDebug() << "html reply" << reply.msg->encodedContent();
+ //qDebug() << "html reply" << reply.msg->encodedContent();
QDateTime date = msg->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime += QLatin1String(" ") + QLocale::system().toString(date.time(), QLocale::LongFormat);
- QString replyStr = QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> encoded?\n")));
- QSKIP("This test has been failing for a long time, please someone fix it", SkipSingle);
+ QString replyStr = QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> encoded?\n\n")));
QCOMPARE(reply.msg->contentType()->mimeType(), QByteArrayLiteral("multipart/alternative"));
QCOMPARE(reply.msg->subject()->asUnicodeString(), QLatin1String("Re: reply to please"));
+ QCOMPARE(reply.msg->contents().count(), 2);
QCOMPARE_OR_DIFF(reply.msg->contents().at(0)->body(), replyStr.toLatin1());
delete identMan;
}