diff --git a/docker-compose.yml b/docker-compose.yml index e97a791b..5de5bd40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: ports: - "8000:8000" environment: - - DATABASE_URL=mysql+pymysql://ctfd:ctfd@db/ctfd + - DATABASE_URL=mysql+pymysql://root:ctfd@db/ctfd volumes: - .data/CTFd/logs:/opt/CTFd/CTFd/logs - .data/CTFd/uploads:/opt/CTFd/CTFd/uploads @@ -15,11 +15,10 @@ services: - db db: - image: mariadb + image: mariadb:10.2 environment: - MYSQL_ROOT_PASSWORD=ctfd - MYSQL_USER=ctfd - MYSQL_PASSWORD=ctfd - - MYSQL_DATABASE=ctfd volumes: - .data/mysql:/var/lib/mysql diff --git a/tests/test_user_facing.py b/tests/test_user_facing.py index a2014918..38abf10a 100644 --- a/tests/test_user_facing.py +++ b/tests/test_user_facing.py @@ -18,7 +18,7 @@ def test_index(): def test_register_user(): - """Can a user can be registered""" + """Can a user be registered""" app = create_ctfd() with app.app_context(): register_user(app) @@ -27,6 +27,16 @@ def test_register_user(): destroy_ctfd(app) +def test_register_unicode_user(): + """Can a user with a unicode name be registered""" + app = create_ctfd() + with app.app_context(): + register_user(app, name="你好") + team_count = app.db.session.query(app.db.func.count(Teams.id)).first()[0] + assert team_count == 2 # There's the admin user and the created user + destroy_ctfd(app) + + def test_register_duplicate_teamname(): """A user shouldn't be able to use an already registered team name""" app = create_ctfd()