diff --git a/isso/db.py b/isso/db.py index 12bbdf0..d7dc0e0 100644 --- a/isso/db.py +++ b/isso/db.py @@ -76,7 +76,7 @@ class SQLite(Abstract): fields = [ 'path', 'id', 'created', 'modified', - 'text', 'author', 'email', 'website', 'parent', 'mode' + 'text', 'author', 'hash', 'website', 'parent', 'mode' ] def __init__(self, dbpath, moderation): @@ -87,8 +87,9 @@ class SQLite(Abstract): with sqlite3.connect(self.dbpath) as con: sql = ('main.comments (path VARCHAR(255) NOT NULL, id INTEGER NOT NULL,' 'created FLOAT NOT NULL, modified FLOAT, text VARCHAR,' - 'author VARCHAR(64), email VARCHAR(64), website VARCHAR(64),' - 'parent INTEGER, mode INTEGER, hash CHAR(32), PRIMARY KEY (id, path))') + 'author VARCHAR(64), hash VARCHAR(32), website VARCHAR(64),' + 'parent INTEGER, mode INTEGER,' + 'PRIMARY KEY (id, path))') con.execute("CREATE TABLE IF NOT EXISTS %s;" % sql) # increment id if (id, path) is no longer unique diff --git a/specs/test_comment.py b/specs/test_comment.py index 72b9e9f..de619bf 100644 --- a/specs/test_comment.py +++ b/specs/test_comment.py @@ -1,4 +1,5 @@ +import os import json import urllib import tempfile @@ -35,6 +36,9 @@ class TestComments(unittest.TestCase): self.post = self.client.post self.delete = self.client.delete + def tearDown(self): + os.unlink(self.path) + def testGet(self): self.post('/new?uri=%2Fpath%2F', data=json.dumps({'text': 'Lorem ipsum ...'}))