Improve the tests, add a new debug endpoint

This commit is contained in:
Thomas Sileo
2018-05-27 11:50:09 +02:00
parent 25a75a9cef
commit cf242b2d84
4 changed files with 52 additions and 3 deletions

View File

@@ -62,7 +62,15 @@ mongo_client = MongoClient(
host=[os.getenv('MICROBLOGPUB_MONGODB_HOST', 'localhost:27017')],
)
DB = mongo_client['{}_{}'.format(USERNAME, DOMAIN.replace('.', '_'))]
DB_NAME = '{}_{}'.format(USERNAME, DOMAIN.replace('.', '_'))
DB = mongo_client[DB_NAME]
def _drop_db():
if not DEBUG_MODE:
return
mongo_client.drop_database(DB_NAME)
KEY = Key(USERNAME, DOMAIN, create=True)
ME = {