Merge imports
This commit is contained in:
parent
c433a7d561
commit
a0c0aa760d
@ -1,15 +1,14 @@
|
|||||||
from base64 import urlsafe_b64encode
|
from base64 import urlsafe_b64encode
|
||||||
|
|
||||||
import ecdsa
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from djangoldp_webpushnotification.models import VAPIDKeyset
|
from djangoldp_webpushnotification.models import VAPIDKeyset
|
||||||
from ecdsa import SigningKey
|
from ecdsa import NIST256p, SigningKey
|
||||||
|
|
||||||
|
|
||||||
class TestVAPIDKeySet(TestCase):
|
class TestVAPIDKeySet(TestCase):
|
||||||
def test_vapidkeyset_public_key(self):
|
def test_vapidkeyset_public_key(self):
|
||||||
priv_key = SigningKey.generate(curve=ecdsa.NIST256p)
|
priv_key = SigningKey.generate(curve=NIST256p)
|
||||||
vapid_key_set = VAPIDKeyset.objects.create(
|
vapid_key_set = VAPIDKeyset.objects.create(
|
||||||
private_key=urlsafe_b64encode(priv_key.to_string()).strip(b"=")
|
private_key=urlsafe_b64encode(priv_key.to_string()).strip(b"=")
|
||||||
)
|
)
|
||||||
assert isinstance(vapid_key_set.public_key, bytes)
|
assert isinstance(vapid_key_set.public_key, bytes)
|
||||||
|
Reference in New Issue
Block a user