Skip to content

Commit

Permalink
Fix tests with expired certs
Browse files Browse the repository at this point in the history
  • Loading branch information
tpazderka committed Jul 3, 2023
1 parent ff481a7 commit 7e0c343
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django_fido/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import base64
import json
from typing import cast
from unittest.mock import patch

from django.core.exceptions import ValidationError
from django.test import SimpleTestCase, TestCase
Expand Down Expand Up @@ -122,10 +123,12 @@ def test_metadata_no_identification(self):
authenticator = Authenticator(attestation_data=ATTESTATION_OBJECT)
self.assertIsNone(authenticator.metadata)

def test_metadata_aaguid(self):
@patch('django_fido.models.crypto')
def test_metadata_aaguid(self, crypto_mock):
metadata = AuthenticatorMetadata.objects.create(identifier='95442b2e-f15e-4def-b270-efb106facb4e',
detailed_metadata_entry=json.dumps(DETAILED_METADATA))
authenticator = Authenticator(attestation_data=ATTESTATION_OBJECT_AAGUID)
crypto_mock.verify_certificate.return_value = True
self.assertEqual(authenticator.metadata, metadata)

def test_metadata_aaguid_wrong_cert(self):
Expand Down

0 comments on commit 7e0c343

Please sign in to comment.