Added tests for user service
This commit is contained in:
@@ -13,11 +13,13 @@ class QuotaService:
|
||||
""" Check if the current user quota surpasses the current quota """
|
||||
# TODO We need to add the hard/soft limit flag for the geocoder
|
||||
user_quota = self.user_service.user_quota()
|
||||
current_used = self.user_service.used_quota_month()
|
||||
today = date.today()
|
||||
current_used = self.user_service.used_quota_month(today.year, today.month)
|
||||
return True if (current_used + 1) < user_quota else False
|
||||
|
||||
def increment_geocoder_use(self, amount=1):
|
||||
self.user_service.increment_geocoder_use(self.transaction_id)
|
||||
today = date.today()
|
||||
self.user_service.increment_geocoder_use(today.year, today.month, self.transaction_id)
|
||||
|
||||
@property
|
||||
def user_service(self):
|
||||
|
||||
Reference in New Issue
Block a user