From 6900f3f751056c6189d718f8ea162371e3e2fca0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 1 Jul 2018 11:29:10 +0200 Subject: Remove existing accounts before setting up new accounts. --- tests/teststore.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/teststore.cpp b/tests/teststore.cpp index 73e34101..71b19499 100644 --- a/tests/teststore.cpp +++ b/tests/teststore.cpp @@ -189,6 +189,13 @@ static void createCalendar(const QVariantMap &object) void TestStore::setup(const QVariantMap &map) { using namespace Sink::ApplicationDomain; + + //Cleanup any old data + const auto accounts = Sink::Store::read({}); + for (const auto &account : accounts) { + Sink::Store::remove(account).exec().waitForFinished(); + } + iterateOverObjects(map.value("accounts").toList(), [&] (const QVariantMap &object) { auto account = ApplicationDomainType::createEntity("", object["id"].toByteArray()); account.setName(object["name"].toString()); -- cgit v1.2.3