diff options
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()); |