-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for allowing inactive users to do password reset
- Loading branch information
Showing
2 changed files
with
41 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
Tests for user registration-related views | ||
""" | ||
from django.core import mail | ||
from django.test import TestCase, override_settings | ||
from django.urls import reverse | ||
|
||
from .utils import CacheControlAssertions, CreateTestUsers, JSONAssertMixin | ||
|
||
|
||
@override_settings(RATELIMIT_ENABLE=False) | ||
class ConcordiaViewTests( | ||
JSONAssertMixin, CacheControlAssertions, TestCase, CreateTestUsers | ||
): | ||
def test_inactiveUserCanPasswordReset(self): | ||
""" | ||
Test the ability to activate a user account based on password reset | ||
""" | ||
self.user = self.create_inactive_user("tester") | ||
|
||
self.client.post(reverse("password_reset"), {"email": self.user.email}) | ||
|
||
self.assertEqual(len(mail.outbox), 1) | ||
|
||
|
||
# def test_userActivationViaEmailConfirmation(self): | ||
# self.user = self.create_inactive_user("tester") |
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