diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2016-11-09 16:28:50 -0500 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2016-11-09 16:28:50 -0500 |
| commit | 347495153c8dbea68980c235f01e03d959071416 (patch) | |
| tree | 03c76e050f8bf7a8d835c3bc4cb2c5668664ab27 /passlib/tests | |
| parent | 38505f8defff85c3ee7a0cd8ac874e71f4e55214 (diff) | |
| download | passlib-347495153c8dbea68980c235f01e03d959071416.tar.gz | |
totp: fixed edge case where default issuer was being inserted into json string.
Diffstat (limited to 'passlib/tests')
| -rw-r--r-- | passlib/tests/test_totp.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/passlib/tests/test_totp.py b/passlib/tests/test_totp.py index ec22094..5fd85c2 100644 --- a/passlib/tests/test_totp.py +++ b/passlib/tests/test_totp.py @@ -1495,6 +1495,15 @@ class TotpTest(TestCase): dict(v=1, type="totp", key=KEY4, issuer="Example Org")) + # don't serialize default issuer + TotpFactory = TOTP.using(issuer="Example Org") + otp = TotpFactory(KEY4) + self.assertEqual(otp.to_dict(), dict(v=1, type="totp", key=KEY4)) + + # don't serialize default issuer *even if explicitly set* + otp = TotpFactory(KEY4, issuer="Example Org") + self.assertEqual(otp.to_dict(), dict(v=1, type="totp", key=KEY4)) + #------------------------------------------------------------------------- # algorithm parameter #------------------------------------------------------------------------- |
