mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user