Skip to content

Commit 0252408

Browse files
authored
add lookup iexact (#39)
1 parent 79237e9 commit 0252408

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pgcrypto/fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ class EncryptedInLookup(FieldGetDbPrepValueIterableMixin, EncryptedLookup):
320320

321321
for lookup_name in (
322322
"exact",
323+
"iexact",
323324
"gt",
324325
"gte",
325326
"lt",

testapp/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ def test_concat_decrypt(self):
262262
).get(ssn="999-05-6728")
263263
self.assertEqual(employee.value, "999-05-6728 - 42")
264264

265+
def test_exact(self):
266+
employee = Employee.objects.filter(email__exact="[email protected]").get()
267+
self.assertEqual(employee.email, "[email protected]")
268+
269+
def test_iexact(self):
270+
employee = Employee.objects.filter(email__iexact="[email protected]").get()
271+
self.assertEqual(employee.email, "[email protected]")
272+
265273
def test_contains(self):
266274
employee = Employee.objects.filter(email__contains="sal").get()
267275
self.assertEqual(employee.email, "[email protected]")

0 commit comments

Comments
 (0)