CTFd creates the database instead of the docker-compose files which allows us to control encoding. Also adds a test for registering with a unicode team name.
This commit is contained in:
Kevin Chung
2017-07-16 02:50:32 -04:00
committed by GitHub
parent 5d35497f0c
commit b900d1cb68
2 changed files with 13 additions and 4 deletions

View File

@@ -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()