@@ -16,6 +16,15 @@
|
||||
|
||||
import user_agents
|
||||
|
||||
from app.utils import make_valid_username
|
||||
|
||||
|
||||
def test_make_valid_username():
|
||||
assert make_valid_username("rubenwardy") == "rubenwardy"
|
||||
assert make_valid_username("Test123._-") == "Test123._-"
|
||||
assert make_valid_username("Foo Bar") == "Foo_Bar"
|
||||
assert make_valid_username("François") == "Fran_ois"
|
||||
|
||||
|
||||
def test_web_is_not_bot():
|
||||
assert not user_agents.parse("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0").is_bot
|
||||
|
||||
Reference in New Issue
Block a user