def test_generate_totp_secret_length(self): for length in [5, 10, 20, 30, 40, 50]: secret = auth.generate_totp_secret(length) self.assertEqual(type(secret), six.text_type) self.assertEqual(len(secret), length * 8 / 5)
def test_generate_totp_secret_length(self): for length in [5, 10, 20, 30, 40, 50]: secret = auth.generate_totp_secret(length) self.assertEqual(type(secret), str) self.assertEqual(len(secret), length * 8 / 5)
def test_generate_totp_secret_default(self): secret = auth.generate_totp_secret() self.assertEqual(type(secret), six.text_type) self.assertEqual(len(secret), 10 * 8 / 5)
def test_generate_totp_secret_default(self): secret = auth.generate_totp_secret() self.assertEqual(type(secret), str) self.assertEqual(len(secret), 10 * 8 / 5)