We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9961209 commit 105c84fCopy full SHA for 105c84f
tests/test_types.py
@@ -1,4 +1,6 @@
1
from sqlorm.types import SQLType
2
+from sqlorm.types.encrypted import Encrypted
3
+import hashlib
4
5
6
def test_type():
@@ -16,4 +18,12 @@ def test_type():
16
18
class T:
17
19
__sqltype__ = "customtype"
20
- assert SQLType.from_pytype(T).sql_type == "customtype"
21
+ assert SQLType.from_pytype(T).sql_type == "customtype"
22
+
23
24
+def test_encrypted():
25
+ key = hashlib.md5(b"key").digest()
26
+ t = Encrypted(key)
27
+ assert t.sql_type == "text"
28
+ assert t.dumper("value") != "value"
29
+ assert t.loader(t.dumper("value")) == "value"
0 commit comments