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

Commit

Permalink
Whittle down further
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed May 31, 2017
1 parent a3872a5 commit a95aa87
Showing 1 changed file with 10 additions and 35 deletions.
45 changes: 10 additions & 35 deletions tests/py/test_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,53 +189,28 @@ def make_alice(self):
, last_paypal_result=''
)

def test_can_create_new_team(self):
def test_a(self):
self.make_alice()
r = self.post_new(dict(self.valid_data))
team = self.db.one("SELECT * FROM teams")
assert team
assert team.owner == 'alice'
assert json.loads(r.body)['review_url'] == team.review_url
self.post_new(dict(self.valid_data))

def test_all_fields_persist(self):
def test_aa(self):
self.make_alice()
self.post_new(dict(self.valid_data))
team = T('gratiteam')
assert team.name == 'Gratiteam'
assert team.homepage == 'http://gratipay.com/'
assert team.product_or_service == 'We make widgets.'
assert team.review_url == 'some-github-issue'

def test_casing_of_urls_survives(self):
def test_aaa(self):
self.make_alice()
self.post_new(dict( self.valid_data
, homepage='Http://gratipay.com/'
))
team = T('gratiteam')
assert team.homepage == 'Http://gratipay.com/'
self.post_new(dict(self.valid_data))

def test_casing_of_slug_survives(self):
def test_aaaa(self):
self.make_alice()
data = dict(self.valid_data)
data['name'] = 'GratiTeam'
self.post_new(dict(data))
team = T('GratiTeam')
assert team is not None
assert team.slug_lower == 'gratiteam'
self.post_new(dict(self.valid_data))

def test_application_email_sent_to_owner(self):
def test_aaaaa(self):
self.make_alice()
self.post_new(dict(self.valid_data))
last_email = self.get_last_email()
self.app.email_queue.flush()
assert last_email['to'] == 'alice <[email protected]>'
expected = "Thanks for your project application for"
assert expected in last_email['body_text']


def test_error_message_for_slug_collision(self):
def test_b(self):
self.make_alice()
self.post_new(dict(self.valid_data))
r = self.post_new(dict(self.valid_data), expected=400)
assert self.db.one("SELECT COUNT(*) FROM teams") == 1
assert "Sorry, there is already a team using 'Gratiteam'." in r.body
self.post_new(dict(self.valid_data), expected=400)

0 comments on commit a95aa87

Please sign in to comment.