Commits

Peter Sagerson committed 01327f6 Merge

Merge from v0.1.x

Comments (0)

Files changed (1)

django-otp-yubikey/otp_yubikey/tests.py

 
 
 class YubikeyTest(TestCase):
-    alice_public = b'cccccccb'
-    alice_aes = unhexlify(b'fb362a0853be5e5306d5cc2483f279cb')
+    # YubiKey device simulators.
     alice_key = YubiKey(unhexlify(b'5dc30490956b'), 6, 0)
-
-    bob_public = b'cccccccd'
     bob_key = YubiKey(unhexlify(b'326f70826d31'), 11, 0)
-    bob_aes = unhexlify(b'11080a0e7a56d0a1546f327f20626308')
 
     def setUp(self):
         try:
             self.alice_device = alice.yubikeydevice_set.create(
                 private_id='5dc30490956b',
                 key='fb362a0853be5e5306d5cc2483f279cb', session=5, counter=0)
+            self.alice_public = self.alice_device.public_id()
+
             self.bob_device = bob.yubikeydevice_set.create(
                 private_id='326f70826d31',
                 key='11080a0e7a56d0a1546f327f20626308', session=10, counter=3)
+            self.bob_public = self.bob_device.public_id()
 
     def test_verify_alice(self):
         _, token = self.alice_token()
             otp.counter = counter
 
         return otp, encode_otp(otp, self.alice_aes, self.alice_public)
+
+    @property
+    def alice_aes(self):
+        return self.alice_device.bin_key
+
+    @property
+    def bob_aes(self):
+        return self.bob_device.bin_key