-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add util function to generate qr code for url
- Loading branch information
1 parent
35f1a9b
commit 727da71
Showing
4 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add functionality to create QR codes to a given url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import qrcode.image.pil | ||
from nav.web.utils import convert_pil_object_to_bytes_string, generate_qr_code | ||
|
||
import qrcode | ||
|
||
|
||
def test_generate_qr_code_returns_string(): | ||
qr_code = generate_qr_code(url="www.example.com", name="buick.lab.uninett.no") | ||
assert isinstance(qr_code, qrcode.image.pil.PilImage) | ||
qr_code_bytes_string = convert_pil_object_to_bytes_string(qr_code) | ||
assert isinstance(qr_code_bytes_string, str) |