-
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.
Merge pull request #590 from BersDan/master
User Register Test
- Loading branch information
Showing
1 changed file
with
11 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -107,7 +107,7 @@ def test_login_user__bad_email(self): | |
|
||
def test_register_user(self): | ||
client = self.client | ||
|
||
form_data = {"username": u"test_user1", | ||
"email": u"[email protected]", | ||
"first_name": u"Иван", | ||
|
@@ -124,9 +124,19 @@ def test_register_user(self): | |
|
||
user.is_active = True | ||
user.save() | ||
self.assertEqual(user.username, "test_user1") | ||
self.assertEqual(user.email, "[email protected]") | ||
self.assertEqual(user.first_name, "Иван") | ||
self.assertEqual(user.last_name, "Иванов") | ||
|
||
self.assertTrue(client.login(username="test_user1", password="qwer1")) | ||
|
||
user_profile = UserProfile.objects.get(user=user) | ||
|
||
self.assertEqual(user_profile.show_email, True) | ||
|
||
self.assertEqual(user_profile.is_active(), True) | ||
|
||
def test_register_user__login_already_exists(self): | ||
client = self.client | ||
|
||
|