diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-01 11:29:10 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-01 11:29:10 +0200 |
commit | 6900f3f751056c6189d718f8ea162371e3e2fca0 (patch) | |
tree | ac0edd61386653a0bcdea6de37559523df4c033a /tests/teststore.cpp | |
parent | ec0f93967e210e40d0ddada277866dc599ba2191 (diff) | |
download | kube-6900f3f751056c6189d718f8ea162371e3e2fca0.tar.gz kube-6900f3f751056c6189d718f8ea162371e3e2fca0.zip |
Remove existing accounts before setting up new accounts.
Diffstat (limited to 'tests/teststore.cpp')
-rw-r--r-- | tests/teststore.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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) | |||
189 | void TestStore::setup(const QVariantMap &map) | 189 | void TestStore::setup(const QVariantMap &map) |
190 | { | 190 | { |
191 | using namespace Sink::ApplicationDomain; | 191 | using namespace Sink::ApplicationDomain; |
192 | |||
193 | //Cleanup any old data | ||
194 | const auto accounts = Sink::Store::read<SinkAccount>({}); | ||
195 | for (const auto &account : accounts) { | ||
196 | Sink::Store::remove(account).exec().waitForFinished(); | ||
197 | } | ||
198 | |||
192 | iterateOverObjects(map.value("accounts").toList(), [&] (const QVariantMap &object) { | 199 | iterateOverObjects(map.value("accounts").toList(), [&] (const QVariantMap &object) { |
193 | auto account = ApplicationDomainType::createEntity<SinkAccount>("", object["id"].toByteArray()); | 200 | auto account = ApplicationDomainType::createEntity<SinkAccount>("", object["id"].toByteArray()); |
194 | account.setName(object["name"].toString()); | 201 | account.setName(object["name"].toString()); |