This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3872a5
commit a95aa87
Showing
1 changed file
with
10 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) |