added test for backing up user datastore
This commit is contained in:
parent
f945b7f79e
commit
95f0ff3563
|
@ -1,8 +1,11 @@
|
|||
import pytest
|
||||
import os
|
||||
|
||||
from selenium.webdriver import Chrome
|
||||
from imaginaerraum_door_admin import create_app
|
||||
|
||||
os.environ['APPLICATION_SETTINGS'] = os.getcwd() + '/debug_app_config.py'
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def app():
|
||||
|
|
|
@ -154,6 +154,18 @@ def temp_admin(client_authenticated):
|
|||
'password': password}
|
||||
|
||||
|
||||
def test_backup_users(client_authenticated, temp_user):
|
||||
# test with invalid token
|
||||
response = client_authenticated.get("/backup_user_datastore",
|
||||
follow_redirects=True)
|
||||
user_data = json.loads(response.data)
|
||||
users = [d['username'] for d in user_data]
|
||||
emails = [d['email'] for d in user_data]
|
||||
|
||||
assert temp_user['username'] in users
|
||||
assert temp_user['email'] in emails
|
||||
|
||||
|
||||
def test_create_admin(client_authenticated):
|
||||
password = create_user(client_authenticated, 'bilbo', 'bilbo@shire.me')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user