Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Added test for invalid character in team names.
Browse files Browse the repository at this point in the history
  • Loading branch information
aandis committed Mar 6, 2016
1 parent 3514711 commit 6b05dc3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/py/test_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]', 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='[email protected]', last_paypal_result='')
self.post_new(dict(self.valid_data))
Expand Down

0 comments on commit 6b05dc3

Please sign in to comment.