From e4551a95511491913b46a2c66f39d616873aa487 Mon Sep 17 00:00:00 2001 From: Daniel Gray Date: Wed, 31 Jul 2024 10:03:53 +0200 Subject: [PATCH] updated test and token comments --- app/accounts/tests/test_token.py | 8 ++------ app/accounts/tokens.py | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) 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. """