Commit a8d4cc07 by Clinton Blackburn

Merge pull request #11 from edx/date-format

Added API date format to Client
parents 55b73d84 35ba7aa6
...@@ -21,6 +21,9 @@ class Client(object): ...@@ -21,6 +21,9 @@ class Client(object):
way to get access to those classes and their methods. way to get access to those classes and their methods.
""" """
# Date format to be used when sending and parsing data from the API
DATE_FORMAT = '%Y-%m-%d'
def __init__(self, base_url, auth_token=None, timeout=0.25): def __init__(self, base_url, auth_token=None, timeout=0.25):
""" """
Initialize the client. Initialize the client.
......
...@@ -22,6 +22,10 @@ class ClientTests(ClientTestCase): ...@@ -22,6 +22,10 @@ class ClientTests(ClientTestCase):
httpretty.disable() httpretty.disable()
httpretty.reset() httpretty.reset()
def test_date_format(self):
self.assertEqual(Client.DATE_FORMAT, '%Y-%m-%d')
self.assertEqual(Client('').DATE_FORMAT, '%Y-%m-%d')
def test_has_resource(self): def test_has_resource(self):
httpretty.register_uri(httpretty.GET, self.test_url, body='') httpretty.register_uri(httpretty.GET, self.test_url, body='')
self.assertEquals(self.client.has_resource(self.test_endpoint), True) self.assertEquals(self.client.has_resource(self.test_endpoint), True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment