From 25bf9b63722fc3f25d45623712f01f8c2eb3d550 Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Tue, 14 Jun 2016 10:28:35 +0200 Subject: [PATCH] Add test_orgs_should_write_zero_padded_dates #204 --- .../lib/python/cartodb_services/test/test_user_service.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/lib/python/cartodb_services/test/test_user_service.py b/server/lib/python/cartodb_services/test/test_user_service.py index d9a1398..a73e00b 100644 --- a/server/lib/python/cartodb_services/test/test_user_service.py +++ b/server/lib/python/cartodb_services/test/test_user_service.py @@ -123,6 +123,14 @@ class TestUserService(TestCase): assert self.redis_conn.zscore('user:test_user:geocoder_here:success_responses:201506', '01') == 1 assert self.redis_conn.zscore('user:test_user:geocoder_here:success_responses:201506', '1') == None + def test_orgs_should_write_zero_padded_dates(self): + us = self.__build_user_service('test_user', orgname='test_org') + us.increment_service_use(self.NOKIA_GEOCODER, 'success_responses', + amount=400, + date=date(2015,6,1)) + assert self.redis_conn.zscore('org:test_org:geocoder_here:success_responses:201506', '01') == 400 + assert self.redis_conn.zscore('org:test_org:geocoder_here:success_responses:201506', '1') == None + def __build_user_service(self, username, quota=100, service='heremaps', orgname=None, soft_limit=False,