diff --git a/app/accounts/tests/test_token.py b/app/accounts/tests/test_token.py index 30165e06..6449bbe1 100644 --- a/app/accounts/tests/test_token.py +++ b/app/accounts/tests/test_token.py @@ -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) diff --git a/app/accounts/tokens.py b/app/accounts/tokens.py index 042191d9..fc9df906 100644 --- a/app/accounts/tokens.py +++ b/app/accounts/tokens.py @@ -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. """