Skip to content

Commit 8f539cb

Browse files
committed
Re-factor test assertions with less variables
1 parent f551606 commit 8f539cb

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/encryption_/test_fields.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,19 @@ def test_big_integer(self):
9595
self.assertRange(EncryptedBigIntegerTest, low=100, high=200, threshold=150)
9696

9797
def test_date(self):
98-
d1 = datetime.date(2024, 6, 1)
99-
d2 = datetime.date(2024, 6, 10)
100-
self.assertRange(EncryptedDateTest, low=d1, high=d2, threshold=datetime.date(2024, 6, 5))
98+
self.assertRange(
99+
EncryptedDateTest,
100+
low=datetime.date(2024, 6, 1),
101+
high=datetime.date(2024, 6, 10),
102+
threshold=datetime.date(2024, 6, 5),
103+
)
101104

102105
def test_datetime(self):
103-
dt1 = datetime.datetime(2024, 6, 1, 12, 0)
104-
dt2 = datetime.datetime(2024, 6, 2, 12, 0)
105106
self.assertRange(
106-
EncryptedDateTimeTest, low=dt1, high=dt2, threshold=datetime.datetime(2024, 6, 2, 0, 0)
107+
EncryptedDateTimeTest,
108+
low=datetime.datetime(2024, 6, 1, 12, 0),
109+
high=datetime.datetime(2024, 6, 2, 12, 0),
110+
threshold=datetime.datetime(2024, 6, 2, 0, 0),
107111
)
108112

109113
def test_decimal(self):

0 commit comments

Comments
 (0)