-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RED] Modify test to fix regis flow.
- Loading branch information
1 parent
63092d0
commit 0d73842
Showing
3 changed files
with
8 additions
and
3 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 |
---|---|---|
|
@@ -87,7 +87,8 @@ def test_missing_fields(self): | |
class LoginTest(BaseTestCase): | ||
|
||
def test_login_successful(self): | ||
data = {'username': 'testuser', 'password': self.password} | ||
self.user2 = AppUser.objects.create_user(email='[email protected]',username='testuser2',password=self.password, is_verified_user=True) | ||
data = {'username': 'testuser2', 'password': self.password} | ||
response = self.client.post(LOGIN_LINK, json.dumps(data), content_type='application/json') | ||
self.assertEqual(response.status_code, 200) | ||
|
||
|
@@ -119,6 +120,8 @@ def test_sent_email(self): | |
self.assertEqual(response.status_code, 200) | ||
self.assertEqual(len(mail.outbox), 1) | ||
self.assertEqual(mail.outbox[0].to, ['[email protected]']) | ||
response = self.client.get(EMAIL_VERIFICATION_LINK) | ||
self.assertEqual(response.status_code, 200) | ||
|
||
def test_valid_verification_token(self): | ||
token = account_token.make_token(self.user) | ||
|
@@ -158,6 +161,8 @@ def test_sent_email_recover_password(self): | |
self.assertEqual(response.status_code, 200) | ||
self.assertEqual(len(mail.outbox), 1) | ||
self.assertEqual(mail.outbox[0].to, ['[email protected]']) | ||
response = self.client.post((RECOVER_PASSWORD_LINK), {'email':'[email protected]'}) | ||
self.assertEqual(response.status_code, 200) | ||
|
||
def test_sent_wrong_email_recover_password(self): | ||
response = self.client.post((RECOVER_PASSWORD_LINK), {'email':'[email protected]'}) | ||
|
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