Skip to content

Commit

Permalink
updated test and token comments
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-gray-tangent committed Jul 31, 2024
1 parent 226cad4 commit e4551a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions app/accounts/tests/test_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ def setUp(self):
def test_make_hash_value_active_user(self):
user = User(1, True)
hash_val = self.generator._make_hash_value(user, self.timestamp)
expected_val = (
six.text_type(user.pk) + six.text_type(self.timestamp) + six.text_type(user.is_active)
)
expected_val = f"{user.pk}{self.timestamp}{user.is_active}"
self.assertEqual(hash_val, expected_val)

def test_make_hash_value_inactive_user(self):
user = User(1, False)
hash_val = self.generator._make_hash_value(user, self.timestamp)
expected_val = (
six.text_type(user.pk) + six.text_type(self.timestamp) + six.text_type(user.is_active)
)
expected_val = f"{user.pk}{self.timestamp}{user.is_active}"
self.assertEqual(hash_val, expected_val)


Expand Down
2 changes: 1 addition & 1 deletion app/accounts/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AccountActivationTokenGenerator(PasswordResetTokenGenerator):
calculated by concatenating the user's primary key, timestamp, and active
status.
DO NOT MODIFY THIS METHOD. UNLESS YOU GET PERMISSION FROM THE PROJECT OWNER.
DO NOT MODIFY THIS METHOD, UNLESS YOU GET PERMISSION FROM THE PROJECT OWNER.
"""

Expand Down

0 comments on commit e4551a9

Please sign in to comment.