From 80c11d676cdf86a09ed6a9e6edf390a8c730a2b6 Mon Sep 17 00:00:00 2001 From: Xu Liu Date: Tue, 23 Apr 2019 11:53:00 -0400 Subject: [PATCH] Use cast_value when comparing DynamoType --- moto/dynamodb2/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moto/dynamodb2/models.py b/moto/dynamodb2/models.py index 0f4594aa4..10fe75c0f 100644 --- a/moto/dynamodb2/models.py +++ b/moto/dynamodb2/models.py @@ -45,16 +45,16 @@ class DynamoType(object): ) def __lt__(self, other): - return self.value < other.value + return self.cast_value < other.cast_value def __le__(self, other): - return self.value <= other.value + return self.cast_value <= other.cast_value def __gt__(self, other): - return self.value > other.value + return self.cast_value > other.cast_value def __ge__(self, other): - return self.value >= other.value + return self.cast_value >= other.cast_value def __repr__(self): return "DynamoType: {0}".format(self.to_json())