def METHOD_NAME(self):
    # Test token_hex.
    for n in (1, 12, 25, 90):
        with self.subTest(n=n):
            s = secrets.token_hex(n)
            self.assertIsInstance(s, str)
            self.assertEqual(len(s), 2*n)
            self.assertTrue(all(c in string.hexdigits for c in s))