Commit 35b92725 authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Merge pull request #518 from yprez/fix-iterator-params

Attempt to fix cursor invocation
parents 5aea145f f49a97d3
......@@ -43,3 +43,13 @@ class TweepyCursorTests(TweepyTestCase):
self.assertEqual(c.iterator.next_cursor, 123456)
self.assertFalse('cursor' in c.iterator.kargs)
@tape.use_cassette('testcursornext.json')
def testcursornext(self):
"""
Test cursor.next() behavior, id being passed correctly.
Regression test for issue #518
"""
cursor = Cursor(self.api.user_timeline, id='twitter').items(5)
status = cursor.next()
self.assertEquals(status.user.screen_name, 'twitter')
......@@ -115,12 +115,11 @@ class IdIterator(BaseIterator):
# This is a special invocation that returns the underlying
# APIMethod class
model = ModelParser().parse(self.method(create=True), data)
if hasattr(self.method, '__self__'):
self.method.__self__.parser = old_parser
result = self.method.__self__.parser.parse(self.method(create=True), data)
else:
result = self.method()
result = model
if len(self.results) != 0:
self.index += 1
......
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