first tests passing
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import os
|
||||
from hashlib import sha256
|
||||
import sqlite3
|
||||
|
||||
|
||||
from server.registration import RegistrationServer
|
||||
@@ -40,7 +42,7 @@ def build_dir(directory):
|
||||
|
||||
cursor.execute("CREATE TABLE confirmations_awaiting(" \
|
||||
"user_id integer, " \
|
||||
"convirmation_id integer PRIMARY KEY AUTOINCREMENT");
|
||||
"convirmation_id integer PRIMARY KEY AUTOINCREMENT)")
|
||||
db.commit()
|
||||
|
||||
cursor.execute("CREATE INDEX username ON users(username)")
|
||||
@@ -107,11 +109,11 @@ def build_dir(directory):
|
||||
create_private_db(directory)
|
||||
create_public_db(directory)
|
||||
|
||||
with open("index.html", "w") as index:
|
||||
with open(os.path.join(directory, "index.html"), "w") as index:
|
||||
index.write("INDEX")
|
||||
|
||||
return {"database": {"users": directory + "private"},
|
||||
"register": {"index": directory + "index.html",
|
||||
return {"database": {"users": os.path.join(directory, "private")},
|
||||
"register": {"index": os.path.join(directory, "index.html"),
|
||||
"enabled": True}
|
||||
}
|
||||
|
||||
@@ -125,5 +127,5 @@ def test_registration(tmpdir):
|
||||
|
||||
server = RegistrationServer(conf, mkhash)
|
||||
|
||||
assert server.index() == "INDEX"
|
||||
assert server.index().read() == "INDEX"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user