'A valid token can be created with a secret other than SECRET_KEY by
using the PasswordResetTokenGenerator.secret attribute.'

def test_token_with_different_secret(self):

    user = User.objects.create_user('tokentestuser', 'test2@example.com', 'testpw')
    new_secret = 'abcdefghijkl'
    p0 = PasswordResetTokenGenerator()
    p0.secret = new_secret
    tk0 = p0.make_token(user)
    self.assertTrue(p0.check_token(user, tk0))
    p1 = PasswordResetTokenGenerator()
    self.assertEqual(p1.secret, settings.SECRET_KEY)
    self.assertNotEqual(p1.secret, new_secret)
    tk1 = p1.make_token(user)
    self.assertFalse(p0.check_token(user, tk1))
    self.assertFalse(p1.check_token(user, tk0))
