-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix `render_to_string()` kwarg. Add django-test-plus for testing Update version
- Loading branch information
Showing
7 changed files
with
65 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from django.contrib.auth.models import User | ||
from django.core.management import call_command | ||
from django.test import TestCase | ||
|
||
from account.models import SignupCode | ||
from pinax.invitations.forms import InviteForm | ||
from pinax.invitations.models import InvitationStat, JoinInvitation | ||
from test_plus.test import TestCase | ||
|
||
|
||
class TestsJoinInvitation(TestCase): | ||
|
@@ -73,3 +73,26 @@ def test_already_invited(self): | |
} | ||
form = InviteForm(user=from_user, data=form_data) | ||
self.assertFalse(form.is_valid()) | ||
|
||
|
||
class ViewTests(TestCase): | ||
|
||
def test_invite_view(self): | ||
"""verify no errors when posting good form data""" | ||
user = self.make_user("amy") | ||
InvitationStat.add_invites(2) | ||
post_data = { | ||
"email_address": "[email protected]" | ||
} | ||
with self.login(user): | ||
self.post("pinax_invitations:invite", data=post_data) | ||
self.response_200() | ||
|
||
def test_invite_view_bad_data(self): | ||
"""verify no errors when posting bad data""" | ||
user = self.make_user("sandee") | ||
post_data = { | ||
} | ||
with self.login(user): | ||
self.post("pinax_invitations:invite", data=post_data) | ||
self.response_200() |
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,5 +1,6 @@ | ||
from django.conf.urls import include, url | ||
|
||
urlpatterns = [ | ||
url(r"^account", include("account.urls")), | ||
url(r"^", include("pinax.invitations.urls", namespace="pinax_invitations")), | ||
] |
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