-
Notifications
You must be signed in to change notification settings - Fork 32
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
Showing
10 changed files
with
55 additions
and
46 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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,31 +1,33 @@ | ||
from django.test import TestCase | ||
from account.models import SignupCode | ||
from kaleo.models import JoinInvitation, InvitationStat | ||
|
||
from django.contrib.auth.models import User | ||
|
||
from account.models import SignupCode | ||
from kaleo.models import JoinInvitation | ||
|
||
|
||
class TestsJoinInvitation(TestCase): | ||
|
||
def setUp(self): | ||
self.to_user = User.objects.create(username='foo1') | ||
self.from_user = User.objects.create(username='foo2') | ||
self.to_user = User.objects.create(username='foo1') | ||
self.from_user = User.objects.create(username='foo2') | ||
self.signup_code = SignupCode.create(email="me@you.com") | ||
self.signup_code.save() | ||
self.status = JoinInvitation.STATUS_ACCEPTED | ||
self.signup_code.save() | ||
self.status = JoinInvitation.STATUS_ACCEPTED | ||
self.invitation = JoinInvitation.objects.create( | ||
from_user = self.from_user, | ||
status = self.status, | ||
signup_code = self.signup_code, | ||
) | ||
from_user=self.from_user, | ||
status=self.status, | ||
signup_code=self.signup_code, | ||
) | ||
|
||
def test_to_user_email(self): | ||
self.assertEqual(self.signup_code.email,"me@you.com") | ||
self.assertEqual(self.signup_code.email, "me@you.com") | ||
|
||
def test_accept(self): | ||
self.invitation.accept(self.to_user) | ||
self.assertEqual(self.from_user.invitationstat.invites_accepted,1) | ||
self.assertEqual(self.from_user.invitationstat.invites_accepted, 1) | ||
|
||
def test_process_independent_joins(self): | ||
|
||
JoinInvitation.process_independent_joins(self.to_user,"me@you.com") | ||
JoinInvitation.process_independent_joins(self.to_user, "me@you.com") | ||
invite = JoinInvitation.objects.get(pk=self.invitation.pk) | ||
self.assertEqual(invite.status,JoinInvitation.STATUS_JOINED_INDEPENDENTLY) | ||
self.assertEqual(invite.status, JoinInvitation.STATUS_JOINED_INDEPENDENTLY) |
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 |
---|---|---|
|
@@ -8,5 +8,3 @@ | |
"", | ||
(r"^", include("kaleo.urls")), | ||
) | ||
|
||
|