From cca3b5cba6c1b47222fb255fcc18206cfaefeb54 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 4 Dec 2011 17:52:01 +0900 Subject: [PATCH] scm ts should be ms too, fix unit tests --- anki/collection.py | 2 +- tests/test_find.py | 6 +++--- tests/test_remote_sync.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/anki/collection.py b/anki/collection.py index c6cc6d12f..7cf8c790f 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -160,7 +160,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""", if not self.schemaChanged(): if check and not runFilter("modSchema", True): raise AnkiError("abortSchemaMod") - self.scm = intTime() + self.scm = intTime(1000) def schemaChanged(self): "True if schema changed since last sync." diff --git a/tests/test_find.py b/tests/test_find.py index ae73d3cb2..98710c08f 100644 --- a/tests/test_find.py +++ b/tests/test_find.py @@ -22,15 +22,15 @@ def test_findCards(): f['Back'] = u'sheep' deck.addNote(f) catCard = f.cards()[0] - f = deck.newNote() - f['Front'] = u'template test' - f['Back'] = u'foo bar' m = deck.models.current(); mm = deck.models t = mm.newTemplate("Reverse") t['qfmt'] = "{{Back}}" t['afmt'] = "{{Front}}" mm.addTemplate(m, t) mm.save(m) + f = deck.newNote() + f['Front'] = u'template test' + f['Back'] = u'foo bar' deck.addNote(f) latestCardIds = [c.id for c in f.cards()] # tag searches diff --git a/tests/test_remote_sync.py b/tests/test_remote_sync.py index 4b07fa20d..8be0d5fab 100644 --- a/tests/test_remote_sync.py +++ b/tests/test_remote_sync.py @@ -87,6 +87,7 @@ def test_remoteSync(): # should report no changes assert ts.client.sync() == "noChanges" # bump local col + ts.client.col.setMod() ts.client.col.save() assert ts.client.sync() == "success" # again, no changes