Skip to content

Commit

Permalink
Fix for #19, now all GET requests lack content type
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Greenfeld committed Apr 24, 2015
1 parent 4bcfb42 commit b840e1b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
History
-------

3.0.5 (2014-04-24)
------------------

* Removed 'content-type' header from GET requests

3.0.4 (2014-03-12)
------------------

Expand Down
2 changes: 1 addition & 1 deletion eventbrite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

__author__ = 'Daniel Greenfeld'
__email__ = '[email protected]'
__version__ = '3.0.4'
__version__ = '3.0.5'


from .client import Eventbrite
Expand Down
2 changes: 1 addition & 1 deletion eventbrite/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def api(self, method, path, data, expansions=()):

@objectify
def get(self, path, data=None, expansions=()):
self.content_type_specified = False
path = format_path(path, self.eventbrite_api_url)
return requests.get(path, headers=self.headers, params=data or {})

Expand Down Expand Up @@ -191,7 +192,6 @@ def post_event(self, data):

def event_search(self, **data):
# Resolves the search result response problem
self.content_type_specified = False
return self.get("/events/search/", data=data)

def webhook_to_object(self, webhook):
Expand Down
1 change: 1 addition & 0 deletions eventbrite/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def create(cls, response):
evbobject.headers = response.headers
evbobject.reason = response.reason
evbobject.status_code = response.status_code
evbobject.request = response.request
api_data_type = reverse(evbobject.resource_uri)
# TODO: figure out what to do with endpoint, which doesn't have defined serializer
# TODO: solve issue with non-standard serializes not mapping directly to defined objects
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
except ImportError:
from distutils.core import setup

__version__ = '3.0.4'
__version__ = '3.0.5'

if sys.argv[-1] == 'tag':
os.system("git tag -a %s -m 'version %s'" % (__version__, __version__))
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def test_api_get(self):
self.assertTrue(isinstance(payload.elapsed, timedelta))
self.assertTrue(isinstance(payload.headers, CaseInsensitiveDict))

self.assertFalse(
'content-type' in payload.request.headers
)

@unittest.skipIf(condition=skip_integration_tests, reason='Needs an OAUTH_TOKEN')
def test_api_post(self):
pass # TODO
Expand Down

0 comments on commit b840e1b

Please sign in to comment.