From 34abe3a1eabb6de83bd2c7b4581541acf0ae2bd2 Mon Sep 17 00:00:00 2001 From: aandis Date: Sun, 6 Mar 2016 15:46:43 +0530 Subject: [PATCH] Added test for invalid character in team names. --- tests/py/test_teams.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/py/test_teams.py b/tests/py/test_teams.py index c06d3b70fd..3562c6f8c7 100644 --- a/tests/py/test_teams.py +++ b/tests/py/test_teams.py @@ -296,6 +296,14 @@ def test_error_message_for_bad_url(self): r = self.post_new(dict(self.valid_data, todo_url='foo'), expected=400) assert "Please enter an http[s]:// URL for the 'To-do URL' field." in r.body + def test_error_message_for_invalid_team_name(self): + self.make_participant('alice', claimed_time='now', email_address='alice@example.com', last_paypal_result='') + data = dict(self.valid_data) + data['name'] = '~Invalid:Name;' + r = self.post_new(data, expected=400) + assert self.db.one("SELECT COUNT(*) FROM teams") == 0 + assert "Sorry, team name contains invalid characters." in r.body + def test_error_message_for_slug_collision(self): self.make_participant('alice', claimed_time='now', email_address='alice@example.com', last_paypal_result='') self.post_new(dict(self.valid_data))