From bc896c21c9b15185fd8119ab188d12608eaa65e5 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 25 Oct 2012 00:42:10 +0900 Subject: [PATCH] fix unit test, add ordinals to db --- anki/storage.py | 58 ++++++++++++++++++++--------------------- tests/test_importing.py | 4 +-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/anki/storage.py b/anki/storage.py index cc6453453..098becc9f 100644 --- a/anki/storage.py +++ b/anki/storage.py @@ -223,38 +223,38 @@ create table if not exists col ( ); create table if not exists notes ( - id integer primary key, - guid text not null, - mid integer not null, - mod integer not null, - usn integer not null, - tags text not null, - flds text not null, - sfld integer not null, - csum integer not null, - flags integer not null, - data text not null + id integer primary key, /* 0 */ + guid text not null, /* 1 */ + mid integer not null, /* 2 */ + mod integer not null, /* 3 */ + usn integer not null, /* 4 */ + tags text not null, /* 5 */ + flds text not null, /* 6 */ + sfld integer not null, /* 7 */ + csum integer not null, /* 8 */ + flags integer not null, /* 9 */ + data text not null /* 10 */ ); create table if not exists cards ( - id integer primary key, - nid integer not null, - did integer not null, - ord integer not null, - mod integer not null, - usn integer not null, - type integer not null, - queue integer not null, - due integer not null, - ivl integer not null, - factor integer not null, - reps integer not null, - lapses integer not null, - left integer not null, - odue integer not null, - odid integer not null, - flags integer not null, - data text not null + id integer primary key, /* 0 */ + nid integer not null, /* 1 */ + did integer not null, /* 2 */ + ord integer not null, /* 3 */ + mod integer not null, /* 4 */ + usn integer not null, /* 5 */ + type integer not null, /* 6 */ + queue integer not null, /* 7 */ + due integer not null, /* 8 */ + ivl integer not null, /* 9 */ + factor integer not null, /* 10 */ + reps integer not null, /* 11 */ + lapses integer not null, /* 12 */ + left integer not null, /* 13 */ + odue integer not null, /* 14 */ + odid integer not null, /* 15 */ + flags integer not null, /* 16 */ + data text not null /* 17 */ ); create table if not exists revlog ( diff --git a/tests/test_importing.py b/tests/test_importing.py index f3d757d9d..a40e68bb2 100644 --- a/tests/test_importing.py +++ b/tests/test_importing.py @@ -146,11 +146,11 @@ def test_csv(): i.run() # four problems - too many & too few fields, a missing front, and a # duplicate entry - assert len(i.log) == 6 + assert len(i.log) == 5 assert i.total == 5 # if we run the import again, it should update instead i.run() - assert len(i.log) == 6 + assert len(i.log) == 5 assert i.total == 5 # but importing should not clobber tags if they're unmapped n = deck.getNote(deck.db.scalar("select id from notes"))