Skip to content

Commit

Permalink
Merge pull request #590 from BersDan/master
Browse files Browse the repository at this point in the history
User Register Test
  • Loading branch information
znick authored Apr 4, 2024
2 parents 265b618 + c4cf72c commit b6c07a4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion anytask/users/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"Иван",
Expand All @@ -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

Expand Down

0 comments on commit b6c07a4

Please sign in to comment.